File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,28 @@ the following operation in the :program:`mongo` shell:
136
136
.. see:: :doc:`/core/object-id` for full documentation of ObjectIds in
137
137
MongoDB.
138
138
139
+ .. _shell-type-long:
140
+
141
+ NumberLong
142
+ ----------
143
+
144
+ The :program:`mongo` shell provides the ``NumberLong()`` class to handle
145
+ numbers of type long.
146
+
147
+ The ``NumberLong()`` accepts the long as a string:
148
+
149
+ .. code-block:: javascript
150
+
151
+ NumberLong("20908458868526654")
152
+
153
+ The following examples use the ``NumberLong()`` class to write to the
154
+ collection:
155
+
156
+ .. code-block:: javascript
157
+
158
+ db.collection.insert( { _id: 10, calc: NumberLong("20908458868526654") } )
159
+ db.collection.update( { _id: 10 },
160
+ { $set: { calc: NumberLong("209084588685266550") } } )
139
161
140
162
.. wiki content -- I don't think the following applies anymore
141
163
You can’t perform that action at this time.
0 commit comments