Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Won't Fix
-
None
-
None
-
1
-
Needed
-
Unlike mongo where numbers are always stored as doubles unless differently specified, mongosh will have the javascript behavior: 1 is an int32, 1.1 is a double.
Description
mongosh should insert number as Double by default.
Currently number in mongosh are inserted as int32 if they can be represented as integer and as double otherwise.
ie.
db.coll1.insertOne({
|
x: 1
|
});
|
will result in a bson document like this:
{
|
_id: 602aa63a5eabf03429d733f1,
|
x: Int32 { _bsontype: 'Int32', value: 1 }
|
}
|
where the old shell would have inserted a Double:
{
|
_id: 602aa5da098e6ce990139172,
|
x: Double { _bsontype: 'Double', value: 1 }
|
}
|
Attachments
Issue Links
- is duplicated by
-
MONGOSH-1032 NumberInt object wrapper is not displayed
-
- Closed
-
- is related to
-
MONGOSH-967 Cannot resize oplog via mongosh
-
- Closed
-
- related to
-
NODE-3164 Mongo JS Driver Inserting Ints Instead of Doubles
-
- Closed
-