Skip to content

Instantly share code, notes, and snippets.

@konrad
Created June 3, 2010 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konrad/424075 to your computer and use it in GitHub Desktop.
Save konrad/424075 to your computer and use it in GitHub Desktop.
Set CouchDB numbers of revision to a certain value
# 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