@@ -66,7 +66,7 @@ document are to be interpreted as described in
66
66
67
67
[ TIP ] : # ( Provide a list of any unique terms or acronyms, and their definitions here. )
68
68
69
- - Mango: CouchDB's Mongo inspired querying system.
69
+ - Mango: CouchDB's Mongo- inspired querying system.
70
70
- View / JSON index: Mango index that uses the same index as Cloudant views.
71
71
- Coordinator: the Erlang process that handles doing a distributed query across
72
72
a CouchDB cluster.
@@ -98,7 +98,7 @@ When choosing a JSON index to use for a query, there are a couple of things that
98
98
are important to covering indexes.
99
99
100
100
Firstly, note there are certain predicate operators that can be used with an
101
- index, currently: ` $lt ` , ` $lte ` , ` $eq ` , $gte` and ` $gt`. These can easily be
101
+ index, currently: ` $lt ` , ` $lte ` , ` $eq ` , ` $gte ` and ` $gt ` . These can easily be
102
102
converted to key operations within a key ordered index. For an index to be
103
103
chosen for a query, the first key within the indexes complex key MUST be used
104
104
with a predicate operator that can be converted into an operation on the index.
@@ -129,11 +129,11 @@ The `selector` `{"age": {"$gt": 30}}` should return both documents. However, if
129
129
we use the index above, we'd miss out ` bar ` because it's not in the index.
130
130
Therefore we can't use the index.
131
131
132
- On the other hand, the ` selector ` `{"age": {"$gt": 30}, "name":
133
- {"$exists"= true}}` requires that the ` name` field exist so the index can be used
134
- because the query predicates can only match documents containing both ` age ` and
135
- ` name ` , just like the index. In both cases, note the predicate `"age": {"$gt":
136
- 30} ` implies ` "age": {"$exists"= true}`.
132
+ On the other hand, the ` selector ` `{"age": {"$gt": 30}, "name": {"$exists":
133
+ true}}` requires that the ` name` field exist so the index can be used because
134
+ the query predicates can only match documents containing both ` age ` and ` name ` ,
135
+ just like the index. In both cases, note the predicate ` "age": {"$gt": 30} `
136
+ implies ` "age": {"$exists": true} ` .
137
137
138
138
## Phase 1: handle keys only covering indexes
139
139
@@ -188,10 +188,11 @@ Behaviour requirements:
188
188
document in order that the document be included in the index. This is to
189
189
allow the index to cover more queries.
190
190
- Including a deeply nested field would follow the same pattern as for other
191
- field references in mango , ` person.address.zip ` .
191
+ field references in Mango , ` person.address.zip ` .
192
192
- There is no notation to include the whole document, that is, no equivalent of
193
193
` emit(doc.name, doc) ` .
194
- - ` "include": [] ` is equivalent to omitting the ` include ` field.
194
+ - ` "include": [] ` , ` "include": null ` and omitting the ` include ` field are all
195
+ equivalent.
195
196
- Ordering of the fields in ` include ` is not important. They can be reordered
196
197
before storing if needed (eg, sorted).
197
198
- It will be an error to include a field in both ` fields ` and ` include ` . This
@@ -240,8 +241,8 @@ Therefore the feature will have the following limit enforcement settings:
240
241
- ` mango_json_index_include_depth_max ` is a limit on the depth of fields we will
241
242
pull out. Basically the maximum numbers of ` . ` in a path.
242
243
- If the total number of bytes for values exceeds
243
- ` mango_json_index_include_size_bytes_max ` then we will skip that document from
244
- the index.
244
+ ` mango_json_index_include_size_bytes_max ` then we will skip that document
245
+ from the index.
245
246
246
247
I need to check whether these should be prefixed ` mango_ ` given they would live
247
248
in a ` mango ` configuration section.
@@ -300,7 +301,7 @@ current behaviour in `view_cb/2`, meaning that it reads the document found via
300
301
` include_docs=true ` , execute ` match_and_extract_doc/3 ` and return the row if it
301
302
matches the query.
302
303
303
- The coordinator will received the final result document as today and assume it's
304
+ The coordinator will receive the final result document as today and assume it's
304
305
correct, and forward it to the client. More work than needed will be carried out
305
306
at the shard. But, again, this doesn't appear to require special code so long as
306
307
we are careful.
0 commit comments