Optional
allowfalse
Optional
bsonreturn BSON regular expressions as BSONRegExp instances.
false
Optional
fieldsallow to specify if there what fields we wish to return as unserialized raw buffer.
null
Optional
indexOffset into buffer to begin reading document from
0
Optional
promotewhen deserializing a Binary will return it as a node.js Buffer instance.
false
Optional
promotewhen deserializing a Long will fit it into a Number if it's smaller than 53 bits.
true
Optional
promotewhen deserializing will promote BSON values to their Node.js closest equivalent types.
true
Optional
rawOptional
usewhen deserializing a Long return as a BigInt.
false
Optional
validationAllows for opt-out utf-8 validation for all keys or specified keys. Must be all true or all false.
// disables validation on all keys
validation: { utf8: false }
// enables validation only on specified keys a, b, and c
validation: { utf8: { a: true, b: true, c: true } }
// disables validation only on specified keys a, b
validation: { utf8: { a: false, b: false } }
Generated using TypeDoc
allows the buffer to be larger than the parsed BSON object.