Mango query, but with keys=[] #3449
Replies: 2 comments 6 replies
-
I must be not understanding -- why can't you use a big Mango is using the exact same mrview file format on the backend, but the functionality is intentionally limited to be only what is possible with declarative statements. This provides predictable performance out of Mango, which can't be guaranteed with an open-ended system like JS views. So, you're not going to see future Mango functionality that supports if/then/else clauses, custom reduces, etc. But future Mango functionality might be more flexible, and CouchDB is always open to future Mango enhancement. |
Beta Was this translation helpful? Give feedback.
-
Hi there, I'm a colleague of Russell's. We're essentially running into this problem: #1853 We'd like to query a view, which can either be represented in JavaScript as {
map: function(doc) {
if ("slug" in doc) { emit(doc.slug, null); }
}
} or in Mango as {
"index": {
"fields": [
"slug"
]
}
} We'd like to query multiple slugs at once, and then filter the fields returned by the response, since many results have a large array field we can ignore for the purposes of this lookup that we'd rather not have to transmit through HTTP. We can perform the lookup effectively with the JavaScript view by sending our list of slugs as the For now we'll presumably have to deal with the performance hit of sending lots of large local HTTP requests. We're comfortable ignoring Mango completely and working with JavaScript views. What I find curious is that the very useful |
Beta Was this translation helpful? Give feedback.
-
We have many scenarios where we need to be able to pass in a set of keys, something we can do with a
/_view/
. We would also like to use other features of the Mango interface, such as only returning specific fields rather than the all-or-nothinginclude_docs
Is there any method to combine these? When I do an /_explain/ I can see the "mrargs", but don't see any method to pass these in and give Mango some additional hints.
Related: Are there plans to allow the Mango interface to be used against a
/_view/
? Merging some of the features of views and indexes would enhance functionality considerably.Thank you in advance for any thoughts.
Beta Was this translation helpful? Give feedback.
All reactions