-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.6.1
-
Component/s: Tools
-
Minor Change
-
Server 2.7.3
A customer reports that it is not very convenient for mongoexport --csv to output ObjectID as a type, while it is not a valid string in the Mongo shell, which accepts ObjectId.
[ec2-user@host]$ mongoexport --db app --collection data -q '{"date.v": {$lt : new Date(1)}}' --csv --fields '_id' -o - _id ObjectID(518d83ba89a92bb3057252eb) ObjectID(525b23207ca1bb3f0c001eac) ObjectID(525b23207ca1bb3f0c001ea4) ObjectID(525b23207ca1bb3f0c001e8c) ObjectID(525b23207ca1bb3f0c001e94) ObjectID(525b23207ca1bb3f0c001e9c) ObjectID(525b23207ca1bb3f0c001eb4) ObjectID(525b23207ca1bb3f0c001e84) mongos> db.app.coveredassets.find({_id: new ObjectID("518d83ba89a92bb3057252eb")}).pretty() 2014-06-13T19:52:04.561+0000 ReferenceError: ObjectID is not defined mongos> db.app.coveredassets.find({_id: new ObjectId("518d83ba89a92bb3057252eb")}).pretty() { "_id" : ObjectId("518d83ba89a92bb3057252eb"), ... }