Skip to content

Commit c6ea642

Browse files
committed
Covering index RFC typos
1 parent fc76a45 commit c6ea642

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/docs/rfcs/018-mango-covering-json-index.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ document are to be interpreted as described in
6666

6767
[TIP]: # ( Provide a list of any unique terms or acronyms, and their definitions here.)
6868

69-
- Mango: CouchDB's Mongo inspired querying system.
69+
- Mango: CouchDB's Mongo-inspired querying system.
7070
- View / JSON index: Mango index that uses the same index as Cloudant views.
7171
- Coordinator: the Erlang process that handles doing a distributed query across
7272
a CouchDB cluster.
@@ -98,7 +98,7 @@ When choosing a JSON index to use for a query, there are a couple of things that
9898
are important to covering indexes.
9999

100100
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
102102
converted to key operations within a key ordered index. For an index to be
103103
chosen for a query, the first key within the indexes complex key MUST be used
104104
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
129129
we use the index above, we'd miss out `bar` because it's not in the index.
130130
Therefore we can't use the index.
131131

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}`.
137137

138138
## Phase 1: handle keys only covering indexes
139139

@@ -188,10 +188,11 @@ Behaviour requirements:
188188
document in order that the document be included in the index. This is to
189189
allow the index to cover more queries.
190190
- 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`.
192192
- There is no notation to include the whole document, that is, no equivalent of
193193
`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.
195196
- Ordering of the fields in `include` is not important. They can be reordered
196197
before storing if needed (eg, sorted).
197198
- 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:
240241
- `mango_json_index_include_depth_max` is a limit on the depth of fields we will
241242
pull out. Basically the maximum numbers of `.` in a path.
242243
- 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.
245246

246247
I need to check whether these should be prefixed `mango_` given they would live
247248
in a `mango` configuration section.
@@ -300,7 +301,7 @@ current behaviour in `view_cb/2`, meaning that it reads the document found via
300301
`include_docs=true`, execute `match_and_extract_doc/3` and return the row if it
301302
matches the query.
302303

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
304305
correct, and forward it to the client. More work than needed will be carried out
305306
at the shard. But, again, this doesn't appear to require special code so long as
306307
we are careful.

0 commit comments

Comments
 (0)