Skip to content

Commit e4a6fc3

Browse files
author
Chris Cho
committed
rst fixes
1 parent e3d8c90 commit e4a6fc3

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

source/code-snippets/collation/find-sort-collation.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
Retrieve documents that match "New York" in the "city" field,
33
sorted by the "name" field by using the German collation.
44
*/
5+
// start find sort collation
56
myColl.find({ city: "New York" }, { collation: { locale: "de" } })
67
.sort({ name: 1 });
8+
// end find sort collation

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
locale collation, specifying ascending ordering of the
44
"title" field.
55
*/
6-
// start index collation
6+
// start create index collation
77
myColl.createIndex(
88
{ 'title' : 1 },
99
{ 'collation' : { 'locale' : 'en_US' } });
10-
// end index collation
10+
// end create index collation

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
in descending order of the value of the "title" field,
44
specifying a collation that uses the index.
55
*/
6+
// start query index collation
67
myColl.find({"year": 1980}, {"collation" : {"locale" : "en_US" }})
7-
.sort({"title": -1});
8+
.sort({"title": -1});
9+
// end query index collation

source/fundamentals/collations.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,15 @@ a collection with a collation set to the "``en_US``" locale.
149149

150150
.. literalinclude:: /code-snippets/collation/index-collation.js
151151
:language: javascript
152-
:start-after: start indexcollation
153-
:end-before: end indexcollation
152+
:start-after: start create index collation
153+
:end-before: end create index collation
154154

155155
The following query uses the index we created:
156156

157157
.. literalinclude:: /code-snippets/collation/query-index-collation.js
158158
:language: javascript
159+
:start-after: start query index collation
160+
:end-before: end query index collation
159161

160162
The following queries **do not** use the index that we created. The first
161163
query does not include a collation and the second contains a different
@@ -188,6 +190,8 @@ setting the value of the ``locale`` parameter to ``de``.
188190

189191
.. literalinclude:: /code-snippets/collation/find-sort-collation.js
190192
:language: javascript
193+
:start-after: start find sort collation
194+
:end-before: end find sort collation
191195

192196
findOneAndUpdate() Example
193197
``````````````````````````

0 commit comments

Comments
 (0)