Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8233727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:13:43+00:00 2026-06-07T18:13:43+00:00

I have some data which we transformed into json so it can be imported

  • 0

I have some data which we transformed into json so it can be imported into mongodb.

For some documents we need to have a date field that lies before 1970.
So we tested the documents by essentially doing this:

[nbasjes@localhost ~]$ echo 'db.datetest.save({"date": new Date(1)});' | mongo nielsbasjes
MongoDB shell version: 2.0.6
connecting to: nielsbasjes
bye
[nbasjes@localhost ~]$ echo 'db.datetest.save({"date": new Date(-1)});' | mongo nielsbasjes
MongoDB shell version: 2.0.6
connecting to: nielsbasjes
bye

and two documents have been inserted.

However when we try to load the same documents using mongoimport we get this:

[nbasjes@localhost ~]$ echo '{"date": new Date(1)}' | mongoimport -vv -d nielsbasjes -c datetest
Thu Jun 21 17:43:19 creating new connection to:127.0.0.1
Thu Jun 21 17:43:19 BackgroundJob starting: ConnectBG
Thu Jun 21 17:43:19 connected connection!
connected to: 127.0.0.1
Thu Jun 21 17:43:19 ns: nielsbasjes.datetest
Thu Jun 21 17:43:19 filesize: 0
Thu Jun 21 17:43:19 got line:{"date": new Date(1)}
Thu Jun 21 17:43:19 got line:
imported 1 objects

So far so good …

[nbasjes@localhost ~]$ echo '{"date": new Date(-1)}' | mongoimport -vv -d nielsbasjes -c datetest
Thu Jun 21 17:43:24 creating new connection to:127.0.0.1
Thu Jun 21 17:43:24 BackgroundJob starting: ConnectBG
Thu Jun 21 17:43:24 connected connection!
connected to: 127.0.0.1
Thu Jun 21 17:43:24 ns: nielsbasjes.datetest
Thu Jun 21 17:43:24 filesize: 0
Thu Jun 21 17:43:24 got line:{"date": new Date(-1)}
Thu Jun 21 17:43:24 Assertion: 10340:Failure parsing JSON string near: "date": ne
0x581a82 0x528610 0xaa3ff3 0xaa5e63 0xa9cccd 0xaa0932 0x3bbb81ecdd 0x4fed69
 mongoimport(_ZN5mongo11msgassertedEiPKc+0x112) [0x581a82]
 mongoimport(_ZN5mongo8fromjsonEPKcPi+0x3d0) [0x528610]
 mongoimport(_ZN6Import8parseRowEPSiRN5mongo7BSONObjERi+0x8b3) [0xaa3ff3]
 mongoimport(_ZN6Import3runEv+0x16e3) [0xaa5e63]
 mongoimport(_ZN5mongo4Tool4mainEiPPc+0x169d) [0xa9cccd]
 mongoimport(main+0x32) [0xaa0932]
 /lib64/libc.so.6(__libc_start_main+0xfd) [0x3bbb81ecdd]
 mongoimport(__gxx_personality_v0+0x3c9) [0x4fed69]
exception:Failure parsing JSON string near: "date": ne

Thu Jun 21 17:43:24 got line:
imported 0 objects
encountered 1 error

We have tried several syntaxes for the same date and we get the same effect with all these forms:

  • {“date”: new Date(-2174520376)}
  • {“date”: new Date(1901,2,3,22,33,44,000)}
  • {“date”: new Date(“February 3, 1901 22:33:44”)

The test system runs CentOS 64Bit with mongo-10gen-2.0.6-mongodb_1.x86_64 and mongo-10gen-server-2.0.6-mongodb_1.x86_64 from the 10gen RPM repository.

How do we solve this?
Or is this a bug in mongoimport that should be reported?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:13:45+00:00Added an answer on June 7, 2026 at 6:13 pm

    I filed this as a bug in the MongoDB bug tracker.
    https://jira.mongodb.org/browse/SERVER-6170

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data which i need to make some statistics. I need to
I have some data which look like that: PMID- 19587274 OWN - NLM DP
I have a Microsoft SQL server DB that imports some data which needs a
I have some data that I've divided into enough groupings that standard boxplots look
I have a question regarding the some data which is being transfered from one
I have some data which (quite reasonably) uses null and false for different meanings.
I have some data (which users input using WYSIWYG editor). I have created a
I have some data which I run through, which generates a textfile. The data
im new to regular expressions in php. I have some data in which some
I have some data from a external party which is encrypted according to them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.