diff --git a/lib/core/sdam/server.js b/lib/core/sdam/server.js index 1c8d788a109..2b76c70e803 100644 --- a/lib/core/sdam/server.js +++ b/lib/core/sdam/server.js @@ -72,7 +72,24 @@ class Server extends EventEmitter { // the server logger logger: Logger('Server', options), // the bson parser - bson: options.bson || new BSON(), + bson: + options.bson || + new BSON([ + BSON.Binary, + BSON.Code, + BSON.DBRef, + BSON.Decimal128, + BSON.Double, + BSON.Int32, + BSON.Long, + BSON.Map, + BSON.MaxKey, + BSON.MinKey, + BSON.ObjectId, + BSON.BSONRegExp, + BSON.Symbol, + BSON.Timestamp + ]), // client metadata for the initial handshake clientInfo: createClientInfo(options), // state variable to determine if there is an active server check in progress diff --git a/lib/core/sdam/topology.js b/lib/core/sdam/topology.js index c644d30ff45..f7d0fa21740 100644 --- a/lib/core/sdam/topology.js +++ b/lib/core/sdam/topology.js @@ -133,7 +133,24 @@ class Topology extends EventEmitter { // allow users to override the cursor factory Cursor: options.cursorFactory || CoreCursor, // the bson parser - bson: options.bson || new BSON(), + bson: + options.bson || + new BSON([ + BSON.Binary, + BSON.Code, + BSON.DBRef, + BSON.Decimal128, + BSON.Double, + BSON.Int32, + BSON.Long, + BSON.Map, + BSON.MaxKey, + BSON.MinKey, + BSON.ObjectId, + BSON.BSONRegExp, + BSON.Symbol, + BSON.Timestamp + ]), // a map of server instances to normalized addresses servers: new Map(), // Server Session Pool