Answer the question
In order to leave comments, you need to log in
How to fix error with $_id_ when loading json in mongodb?
I start to load json into mongodb using the command mongoimport --db test --collection one1 --file my.json and the error
2016-11-01T17:57:23.003+0200 flies insertDocument :: caused by :: 11000 E11000 duplicate key error index : test .one1.$_id_ dup key: { : "01001" }
json example
{ "_id" : "01001", "city" : "AGAWAM", "loc" : [ -72.622739, 42.070206 ], "pop" : 15338, "state" : "MA" }
{ "_id" : "01002", "city" : "CUSHMAN", "loc" : [ -72.51564999999999, 42.377017 ], "pop" : 36963, "state" : "MA" }
etc. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question