Skip to content

Commit 7feae62

Browse files
author
Chris Cho
committed
PRR fixes 1
1 parent 1d77175 commit 7feae62

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

source/code-snippets/collation/aggregation-collation.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
// Retrieve the total matching names, grouped by the first_name field and sorted by using the German phonebook collation
1+
/*
2+
Retrieve the total number of matching names, grouped by the first_name
3+
field and sorted by using the German phonebook collation.
4+
*/
25
myColl.aggregate(
36
[
47
{ $group: { "_id": "$first_name", "nameCount": { "$sum": 1 } } },

source/code-snippets/collation/query-index-collation.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ myColl.find({"year": 1980}, {"collation" : {"locale" : "en_US" }})
99
// end query index collation
1010

1111
// start query without index collation
12-
// no collation specified
1312
/*
1413
Retrieve documents that match the "year" value "1980"
1514
in descending order of the value of the "title" field
@@ -18,7 +17,6 @@ myColl.find({"year": 1980}, {"collation" : {"locale" : "en_US" }})
1817
myColl.find({"year": 1980})
1918
.sort({"title": -1});
2019

21-
// collation differs from the one on the index
2220
/*
2321
Retrieve documents that match the "year" value "1980"
2422
in descending order of the value of the "title" field,

source/fundamentals/collations.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ The following query uses the index we created:
156156
:language: javascript
157157
:start-after: start query index collation
158158
:end-before: end query index collation
159+
:emphasize-lines: 6-7
159160

160161
The following queries **do not** use the index that we created. The first
161162
query does not include a collation and the second contains a different
@@ -166,6 +167,7 @@ strength value than the collation on the index.
166167
:start-after: start query without index collation
167168
:end-before: end query without index collation
168169

170+
169171
Collation Query Examples
170172
~~~~~~~~~~~~~~~~~~~~~~~~
171173

0 commit comments

Comments
 (0)