Skip to content

Instantly share code, notes, and snippets.

@gadamc
Created January 25, 2012 14:23
Show Gist options
  • Save gadamc/1676485 to your computer and use it in GitHub Desktop.
Save gadamc/1676485 to your computer and use it in GitHub Desktop.
from couchdbkit import Server, Database
import datetime
s = Server('https://edelweiss.cloudant.com')
db = s['pulsetemplates']
channelName = 'chalA FID807'
myDate = datetime.datetime(2012, 1, 23 ) #see python's datetime documentation
myDateString = str(myDate)
vr = db.view('analytical/bychandate', reduce=False, limit=1, include_docs=True, descending=True, startkey=[ channelName, myDateString], endkey=[channelName, 0])
doc = vr.first()['doc']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment