You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/04/20 09:00:56 UTC
[GitHub] [couchdb-nano] glynnbird commented on issue #217: Pass arguments in couchdb-nano view function
glynnbird commented on issue #217:
URL: https://github.com/apache/couchdb-nano/issues/217#issuecomment-616411483
A great question, not necessarily anything to do with the Nano library, but a great CouchDB question all the same.
The general case is to create an index on `status` with a map function like this:
```js
function(doc) {
emit(doc.status, 1)
}
```
Then you can query the view for any value of status
```js
db.view('mydesigndoc', 'myview', { key: 'complete' })
// or
db.view('mydesigndoc', 'myview', { key: 'new' })
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org