Skip to content

Instantly share code, notes, and snippets.

@swarbhanu
Created January 31, 2012 19:34
Show Gist options
  • Save swarbhanu/1712443 to your computer and use it in GitHub Desktop.
Save swarbhanu/1712443 to your computer and use it in GitHub Desktop.
A small script to do couchdb operations in coi-services.
from pyon.datastore.couchdb.couchdb_datastore import CouchDB_DataStore
db = CouchDB_DataStore()
# Creates a datastore
datastore_name = 'dm_datastore'
db.create_datastore(datastore_name)
# Create a document
document1 = {'BlogAuthor': {'name' : 'roger', 'email': 'rabbit.com'}}
_id, _rev = db.create_doc(document1, None, datastore_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment