Skip to content

Commit c6df2de

Browse files
authored
DOCSP-24227 adding insert to literal example (#7107)
1 parent 4a46acd commit c6df2de

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

source/reference/operator/aggregation/literal.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ A ``books`` collection has the following documents:
102102

103103
.. code-block:: javascript
104104

105-
{ "_id" : 1, "title" : "Dracula", "condition": "new" }
106-
{ "_id" : 2, "title" : "The Little Prince", "condition": "new" }
105+
db.books.insertMany([
106+
{ "_id" : 1, "title" : "Dracula", "condition": "new" },
107+
{ "_id" : 2, "title" : "The Little Prince", "condition": "new" }
108+
])
107109

108110
The :expression:`{ $literal: 1 } <$literal>` expression returns a new
109111
``editionNumber`` field set to the value ``1``:
@@ -117,6 +119,7 @@ The :expression:`{ $literal: 1 } <$literal>` expression returns a new
117119
The operation results in the following documents:
118120

119121
.. code-block:: javascript
122+
:copyable: false
120123

121124
{ "_id" : 1, "title" : "Dracula", "editionNumber" : 1 }
122125
{ "_id" : 2, "title" : "The Little Prince", "editionNumber" : 1 }

0 commit comments

Comments
 (0)