@@ -44,7 +44,7 @@ snippet to insert documents that describe fruits into the ``myDB.fruits`` collec
4444
4545 await myColl.insertMany([
4646 { "_id": 1, "name": "apples", "qty": 5, "rating": 3 },
47- { "_id": 2, "name": "bananas", "qty": 7, "rating": 1, "microsieverts ": 0.1 },
47+ { "_id": 2, "name": "bananas", "qty": 7, "rating": 1, "color ": "yellow" },
4848 { "_id": 3, "name": "oranges", "qty": 6, "rating": 2 },
4949 { "_id": 4, "name": "avocados", "qty": 3, "rating": 5 },
5050 ]);
@@ -178,12 +178,12 @@ Element Operators
178178
179179Element operators allow you to query based on the presence, absence, or
180180type of a field. The following operation uses the element operator
181- ``$exists`` to search for documents containing the ``microsieverts ``
181+ ``$exists`` to search for documents containing the ``color ``
182182field:
183183
184184.. code-block:: javascript
185185
186- const query = { microsieverts : { $exists: true } };
186+ const query = { color : { $exists: true } };
187187 const cursor = myColl.find(query);
188188 for await (const doc of cursor) {
189189 console.dir(doc);
@@ -194,7 +194,7 @@ This code snippet returns the following results:
194194.. code-block:: javascript
195195 :copyable: false
196196
197- { "_id": 2, "name": "bananas", "qty": 7, "rating": 1, "microsieverts ": 0.1 }
197+ { "_id": 2, "name": "bananas", "qty": 7, "rating": 1, "color ": "yellow" }
198198
199199For more information on this operator, see the reference manual entry for
200200the :manual:`$exists operator </reference/operator/query/exists/>`.
0 commit comments