Performing a WHERE - IN query in CouchDB
问题 I would like to query for a list of particular documents with one call to CouchDB. With SQL I would do something like SELECT * FROM database.table WHERE database.table.id IN (2,4,56); What is a recipe for doing this in CouchDB by either _id or another field? 回答1: You need to use views keys query parameter to get records with keys in specified set. function(doc){ emit(doc.table.id, null); } And then GET /db/_design/ddoc_name/_view/by_table_id?keys=[2,4,56] To retrieve document content in same