-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: CRUD
Command options in the driver, such as batchSize or maxTimeMS currently only accept JS number as their values but Int32 and Long are also valid types for these options. Although this use case would be rare from a general usage standpoint, it has recently shown up in spec tests where loading tests not in EJSON relaxed mode converts these options to their respective non-promoted values and then do not get applied properly since they are not JS number types. Example: https://github.com/mongodb/node-mongodb-native/blob/main/src/cursor/abstract_cursor.ts#L186
We should audit all cases in the driver where this is happening and fix them all.
Note: the design should account for BigInt, pending NODE-3126, but a separate implementation ticket can be filed to actually introduce support for the case.
- Dev note for follow up work: BSON needs to be able to serialize BigInt before it can be supported as options. Once it can be serialized we'll need to audit the many cases of filtering options by typeof number that would prevent BigInt from reaching the BSON layer.