0

I'm using Compass MongoDB to connect to my MongoDB Atlas. I want to import json collection. When I hit import it says "Done" but nothing is happening. What could be the problem?

enter image description here

My json collection is an array of objects:

enter image description here

Dvdgld
  • 1,984
  • 2
  • 15
  • 41

1 Answers1

1

The json syntax looks good, even for the _id, however - in my dbs, the _id is a hex string - that is, it's made up completely of numbers 0-9 and letters a-f, with no special characters like the dash/negative sign you have. I would make a sample file with 2 records, eliminate the _id, see if it imports.

If it does, then make a sample file with those 2 records, with the _id being hex strings, and see if it imports.

If all 4 of those docs (2 from each batch) import properly, the problem is the _id that's not a hex string.

Sheeri
  • 558
  • 3
  • 6
  • Indeed, the problem was with $oid. I deleted them from json, data was imported and $oid autogenerated – Dvdgld Nov 10 '20 at 10:47