Skip to content

Instantly share code, notes, and snippets.

@romanlehnert
Created August 8, 2013 16:06
Show Gist options
  • Save romanlehnert/6185966 to your computer and use it in GitHub Desktop.
Save romanlehnert/6185966 to your computer and use it in GitHub Desktop.
Get a Hash dump from couchbase
c.save_design_doc('{ "_id": "_design/admin", "language": "javascript", "views": { "all": { "map": "function(doc){emit(doc);}" } } }')
docs = Hash[c.design_docs['admin'].all(:include_docs => true).map{ |doc| doc.data }.collect{ |doc| [doc["doc"]["meta"]["id"], doc["doc"]["value"]] }]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment