[SERVER-9648] mongoexport should export date types with milliseconds in csv mode Created: 10/May/13  Updated: 13/Feb/17  Resolved: 11/Oct/13

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 2.4.3
Fix Version/s: 2.5.3

Type: Bug Priority: Major - P3
Reporter: Michael Grundy Assignee: Shaun Verch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Operating System: ALL
Steps To Reproduce:

mongos> use test
switched to db test
 
mongos> db.test.save({d1:Date(), d2:ISODate()})
 
mongos> db.test.find().pretty()
{
	"_id" : ObjectId("518c069cf87f2f3f9fd6daf8"),
	"d1" : "Thu May 09 2013 16:27:08 GMT-0400 (EDT)",
	"d2" : ISODate("2013-05-09T20:27:08.460Z")
}

mongoexport in json mode:

mongoexport -d test -c test
connected to: 127.0.0.1
{ "_id" : { "$oid" : "518c069cf87f2f3f9fd6daf8" }, "d1" : "Thu May 09 2013 16:27:08 GMT-0400 (EDT)", "d2" : { "$date" : 1368131228460 } }

In --csv mode:

$ mongoexport  -d test -c test --csv -f _id,d1,d2
connected to: 127.0.0.1
_id,d1,d2
ObjectID(518c069cf87f2f3f9fd6daf8),"Thu May 09 2013 16:27:08 GMT-0400 (EDT)",2013-05-09T20:27:08Z
exported 1 records

Participants:

 Description   

mongo export in csv mode doesn't export date fields with millisecond resolution as it does for json.



 Comments   
Comment by Maziyar Panahi [ 08/Dec/13 ]

When does this come to the production? Will it be 2.6 or would it be come as 2.4? Thanks

Comment by auto [ 11/Oct/13 ]

Author:

{u'username': u'Zarkantho', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}

Message: SERVER-9648 Change type of date export in csv to include milliseconds
Branch: master
https://github.com/mongodb/mongo/commit/71dbf90bfb81c036e3dd345bb1b5e6d2a798ad9b

Generated at Thu Feb 08 03:21:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.