Skip to content

Commit 1c8bdde

Browse files
vkarpov15mbroadst
authored andcommitted
docs: add FAQ re: undefined
1 parent 890d089 commit 1c8bdde

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,9 @@ The BSON deserializeStream method takes a node.js Buffer, startIndex and allow m
139139
* @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
140140
* @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
141141
* @return {Object} returns the deserialized Javascript Object.
142+
143+
## FAQ
144+
145+
#### Why does `undefined` get converted to `null`?
146+
147+
The `undefined` BSON type has been [deprecated for many years](http://bsonspec.org/spec.html), so this library has dropped support for it. Use the `ignoreUndefined` option (for example, from the [driver](http://mongodb.github.io/node-mongodb-native/2.2/api/MongoClient.html#connect) ) to instead remove `undefined` keys.

0 commit comments

Comments
 (0)