Reputation: 394
Is it possible to simulate this query with couchdb views?
select * from table where key1 = 'value 1' AND key2 = 'value 2';
Upvotes: 0
Views: 288
Reputation: 1148
Yes. Your map function will look like this:
function(doc){
if ( doc.key1 && doc.key2 ){
emit([doc.key1, doc.key2], null);
}
}
And then you would query it like this:
.../myview?startkey=["value 1","value 2"]&endkey=["value 1","value 2"]
Upvotes: 3