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

mongoimport (v2.3.2) bug with dates before unix-epoch. throws : BSON representation of supplied JSON is too large

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.4.0-rc1
    • Affects Version/s: 2.3.2
    • Component/s: None
    • None
    • Environment:
      OS X 10.7.5
    • ALL
    • Hide

      Try to import the attached data.

      or:

      create a document like so:

      • db.test.save( {date : new Date(1500,1)}

        )

      • export it
      • try to import it
      Show
      Try to import the attached data. or: create a document like so: db.test.save( {date : new Date(1500,1)} ) export it try to import it

      I've spotted an issue importing a 2.2.2 exported collection with 2.3.2 mongoimport.

      I am guessing it is because of a date before unix-epoch. (See Data below and attached files). could reproduce it with a various date before 1970

      Workaround(s):

      • use mongodump / mongorestore (works fine in 2.3.2)
      • use mongoimport v. 2.2.x (tested 2.2.2, 2.2.3.rc0)

      Info: It doesn't matter which mongoexport is used.

      Data as in collection:

      {
      	"_id" : ObjectId("4eda7403a232d6a083b3aab3"),
      	"description" : "Man repts. past sighting in 1957 near Mt. Baldy.  Witnessed two bright "white and blue" stars pursued by jet fighters.",
      	"duration" : "",
      	"geoloc" : [
      		34.0239015,
      		-118.1720157
      	],
      	"location" : "E. Los Angeles, CA",
      	"reported_at" : ISODate("1995-07-25T00:00:00Z"),
      	"shape" : " light",
      	"sighted_at" : ISODate("1957-06-01T00:00:00Z")
      }
      

      Data as json:

      { "_id" : { "$oid" : "4eda7403a232d6a083b3aab3" }, "description" : "Man repts. past sighting in 1957 near Mt. Baldy.  Witnessed two bright "white and blue" stars pursued by jet fighters.", "duration" : "", "geoloc" : [ 34.0239015, -118.1720157 ], "location" : "E. Los Angeles, CA", "reported_at" : { "$date" : 806630400000 }, "shape" : " light", "sighted_at" : { "$date" : 18446743676528751616 } }
      

        1. fail.json
          0.4 kB
          Marc Schwering

            Assignee:
            sverch Shaun Verch
            Reporter:
            marc.schwering Marc Schwering
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: