Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9648

mongoexport should export date types with milliseconds in csv mode

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.4.3
    • Fix Version/s: 2.5.3
    • Component/s: Tools
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      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

      Show
      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

      Description

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

        Issue Links

          Activity

          Hide
          auto auto (Inactive) added a comment -

          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

          Show
          auto auto (Inactive) added a comment - 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
          Hide
          maziyar Maziyar Panahi added a comment -

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

          Show
          maziyar Maziyar Panahi added a comment - When does this come to the production? Will it be 2.6 or would it be come as 2.4? Thanks

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                1 year, 38 weeks ago
                Date of 1st Reply: