-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
How are you using Mongo? What version of the server and driver are you using?
I'm using Mongo with Meteor. The driver version is 4.11.0.
What is the feature/improvement you would like?
I would like to see Numbers cast as `bsonType: double` unless explicitly cast otherwise. Basically, I think it should mirror the mongo shell default behavior:
`The mongo shell treats all numbers as floating-point values by default`
This has been discussed previously here: https://jira.mongodb.org/browse/NODE-3164
I think if an integer is desired, then that should be explicitly cast by the user in their application code.
What use case would this feature/improvement enable?
When trying to insert something like `1`, `1.0` or `1.00`, it will be cast as a bsonType: double.
- depends on
-
NODE-4948 Spike: Investigate defaulting javascript numbers to doubles in BSON serialize and EJSON stringify
- Blocked
- related to
-
MONGOSH-602 Numeric values are stored as Int32 instead of Double
- Closed
-
NODE-3164 Mongo JS Driver Inserting Ints Instead of Doubles
- Closed