Last active
July 11, 2016 15:19
-
-
Save cboden/3f758a71d313a4727a43c8b25c35e81c to your computer and use it in GitHub Desktop.
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
curl http://localhost:5984/mydb/aSpecificDocId | |
// Take properties from aSpecificDocId which are keys for the following query | |
curl http://localhost:5984/mydb/_all_docs?keys=["docIdA","docIdB","docIdC","docIdD","docIdE"] |
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
// curl http://localhost:5984/mydb/_design/mydoc/_view/fetch?startkey=["aSpecificDocId","a"]&endkey=["aSpecificDocId","z"]&include_docs=true | |
{ | |
map: function(doc) { | |
if ('thing' === doc.type) { | |
emit([doc._id, doc._id], doc); | |
emit([doc._id, 'a'], {_id: doc.a}); | |
emit([doc._id, 'b'], {_id: doc.b}); | |
emit([doc._id, 'c'], {_id: doc.c}); | |
emit([doc._id, 'd'], {_id: doc.d}); | |
emit([doc._id, 'e'], {_id: doc.e}); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment