File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,30 @@ in ``mongosh`` better align with the types used by the MongoDB Drivers.
202202 For more information on managing types, refer to the
203203 :manual:`schema validation overview </core/schema-validation>`.
204204
205+ Undefined Values
206+ ----------------
207+
208+ The undefined BSON type is `deprecated <https://bsonspec.org/spec.html>`__ in
209+ :binary:`bin.mongosh`. If you insert a document with the undefined JS type in
210+ :binary:`bin.mongosh`, your deployment replaces the undefined value in your
211+ document with the BSON null value. There is no supported way of inserting undefined
212+ values into your database using :binary:`bin.mongosh`.
213+
214+ For example, consider running the following code to insert a document in
215+ :binary:`bin.mongosh`:
216+
217+ .. code-block:: javascript
218+
219+ db.people.insertOne( { name : "Sally", age : undefined } )
220+
221+ When you run this code in :binary:`bin.mongosh`, the shell inserts
222+ the following document:
223+
224+ .. code-block:: javascript
225+ "copyable: false
226+
227+ { name : "Sally", age : null }
228+
205229Object Quoting Behavior
206230-----------------------
207231
You can’t perform that action at this time.
0 commit comments