Skip to content

Commit 9d77578

Browse files
authored
DOCSP 23684 making sparse index example more consistent (#1442) (#1498)
* DOCSP-23684 making index example more consistent * DOCSP-23684 making sparse index example consistent * DOCSP-23684 making sparse index example consistent
1 parent 736e739 commit 9d77578

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

source/core/index-sparse.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,20 @@ index permits the following :doc:`insert operations
227227

228228
.. code-block:: javascript
229229

230-
db.scores.insert( { "userid": "AAAAAAA", "score": 43 } )
231-
db.scores.insert( { "userid": "BBBBBBB", "score": 34 } )
232-
db.scores.insert( { "userid": "CCCCCCC" } )
233-
db.scores.insert( { "userid": "DDDDDDD" } )
230+
db.scores.insertMany( [
231+
{ "userid": "newbie", "score": 43 },
232+
{ "userid": "abby", "score": 34 },
233+
{ "userid": "nina" }
234+
] )
234235

235236
However, the index *would not permit* the addition of the following
236237
documents since documents already exists with ``score`` value of ``82``
237238
and ``90``:
238239

239240
.. code-block:: javascript
240241

241-
db.scores.insert( { "userid": "AAAAAAA", "score": 82 } )
242-
db.scores.insert( { "userid": "BBBBBBB", "score": 90 } )
242+
db.scores.insertMany( [
243+
{ "userid": "newbie", "score": 82 },
244+
{ "userid": "abby", "score": 90 }
245+
] )
246+

0 commit comments

Comments
 (0)