Created
June 3, 2010 16:10
-
-
Save konrad/424075 to your computer and use it in GitHub Desktop.
Set CouchDB numbers of revision to a certain value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set CouchDB numbers of revision to a certain value | |
require "httpclient" | |
COUCH_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/couchdb.yml") | |
environment = "development" | |
server = COUCH_CONFIG[environment]["host"] | |
port = COUCH_CONFIG[environment]["port"] | |
db_root_string = "my_couch" | |
db_name = db_root_string + COUCH_CONFIG[environment]["database_suffix"] | |
client = HTTPClient.new | |
no_of_revisions = 10 | |
url = "http://#{server}:#{port}/#{db_name}/_revs_limit" | |
client.put(url, no_of_revisions) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment