-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Embedded Shell
-
None
-
Not Needed
From the shell, if I execute the following:
db.aggtype.drop(); db.aggtype.insert({key: NumberInt(24), value: 7}); db.aggtype.insert({key: NumberLong(24), value: 8}); db.aggtype.insert({key: 24, value: 5});
and then display the results with a find(), the first document loses its type wrapper:
> db.aggtype.find(); { "_id" : ObjectId("4f569b9a48b5a0bc7ec5828c"), "key" : 24, "value" : 7 } { "_id" : ObjectId("4f569b9a48b5a0bc7ec5828d"), "key" : NumberLong(24), "value" : 8 } { "_id" : ObjectId("4f569b9a48b5a0bc7ec5828e"), "key" : 24, "value" : 5 }
This is deceptive. I know from SERVER-5209 that it is stored as an int, but it looks like a JavaScript double precision float, like the last one.
- duplicates
-
MONGOSH-602 Numeric values are stored as Int32 instead of Double
- Closed
- is duplicated by
-
SERVER-22489 Copy-paste A to B in shell; A != B
- Closed
- related to
-
SERVER-5424 Shell doesn't re-save retrieved integers in an array as integers (converted to 64-bit float)
- Backlog