-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: Legacy C++ Implementation
-
Component/s: mongoimport
-
Environment:osx 10.9.4
mongo 2.6.2
mongoexport creates a json with type information, but longs get converted to integers when mongoimport reads data back in
This is a problem for java, where types matter.
Create a long
> db.export.insert(
)
mongoexport --collection export > export.json
mongoimport --collection import < export.json
In a mongo shell, look at the export and import collections
> db.import.find()
> db.export.find()
{ "_id" : ObjectId("54136bda945c5f71c6d2897f"), "longNum" : NumberLong(123) }The import collection shows the number as in integer instead of a long. The export.json does show the longNum being exported as a $numberLong but the importer fails to respect that.