couchdb-mango

How to define a _find query in couchdb mango with field names that start with dollar sign ($)

青春壹個敷衍的年華 提交于 2019-12-01 22:01:02
问题 Many years ago we launched a project to manage semi-structured information for research projects. We used CouchDB, and at that time it was convenient for us to call the mandatory fields of entries starting with a dollar sign ($) {"id": 123, "$type": "entry", "$owners": ["somebody"],... } I have to clarify that Mango did not exist for CouchDB at that time. Now I would like to run the query to find all the entries of my database which "$type" is "entry". But Mango throws an error because "$type

Couchdb Mango Performance vs Map Reduce Views

寵の児 提交于 2019-11-30 14:50:20
问题 I've just noticed that in the release notes of Couchdb 2.0, it is mentionned that Mango queries are recommended for new applications. It is also mentionned that apparently Mango indexes are from 2x to x10 faster than javascript queries which really surprised me, as such I have a number of questions : Are Map/Reduce views being phased out ? I'm expecting the answer to be no since it seems to me that Mango does not cover all the use cases of Map/Reduce (the easiest example being Reduce itself),

Cloudant/Mango selector for deeply nested JSONs

我怕爱的太早我们不能终老 提交于 2019-11-29 13:03:42
Let's say some of my documents have the following structure: { "something":{ "a":"b" }, "some_other_thing":{ "c":"d" }, "what_i_want":{ "is_down_here":[ { "some":{ "not_needed":"object" }, "another":{ "also_not_needed":"object" }, "i_look_for":"this_tag", "tag_properties":{ "this":"that" } }, { "but_not":{ "down":"here" } } ] } } Is there a Mango JSON selector that can successfully select on "i_look_for" having the value "this_tag" ? It's inside an array (i know its position in the array). I'm also interested on filtering the result so I only get the "tag_properties" in the result. I have

Cloudant/Mango selector for deeply nested JSONs

梦想的初衷 提交于 2019-11-28 06:43:57
问题 Let's say some of my documents have the following structure: { "something":{ "a":"b" }, "some_other_thing":{ "c":"d" }, "what_i_want":{ "is_down_here":[ { "some":{ "not_needed":"object" }, "another":{ "also_not_needed":"object" }, "i_look_for":"this_tag", "tag_properties":{ "this":"that" } }, { "but_not":{ "down":"here" } } ] } } Is there a Mango JSON selector that can successfully select on "i_look_for" having the value "this_tag" ? It's inside an array (i know its position in the array). I

Mango search in Arrays

青春壹個敷衍的年華 提交于 2019-11-28 00:25:55
My document has a structure like this: { "Calibration": { "Presettings": { "Date": [ { "Value": "2016-09-02 10:11", "Type": "generated" }, { "Value": "2016-09-05", "Type": "schedule", "Duration": "5" } ] } } } How must I define the selector part of a query object to get all documents with dates (Value) less or equal to a given date and with Type=='generated' ? First, you need to create your index. I suggest that you create an index on the Calibration.Presettings.Date field . You can use the following JSON object to create it: { "index": { "fields": [ "_id", "Calibration.Presettings.Date.[]

Mango search in Arrays

自闭症网瘾萝莉.ら 提交于 2019-11-27 04:43:34
问题 My document has a structure like this: { "Calibration": { "Presettings": { "Date": [ { "Value": "2016-09-02 10:11", "Type": "generated" }, { "Value": "2016-09-05", "Type": "schedule", "Duration": "5" } ] } } } How must I define the selector part of a query object to get all documents with dates (Value) less or equal to a given date and with Type=='generated' ? 回答1: First, you need to create your index. I suggest that you create an index on the Calibration.Presettings.Date field . You can use