I have many mongodb instance files like below;
[
{
"_id" : ObjectId("35d455de983c0e6a53ea0848"),
"createdAt" : ISODate("2019-12-05T23:25:04.347+0000"),
"__v" : NumberInt(0)
},
{
"_id" : ObjectId("1ecbe0f75df8ccd52a7b1662"),
"createdAt" : ISODate("2019-12-17T12:40:53.521+0000"),
"__v" : NumberInt(0)
}
]
I couldn't import these files because of invalid format.
mongoimport --db DATABASENAME --collection COLLECTIONNAME --file filename.json --jsonArray
And it says;
Failed: invalid JSON input. Position: 16. Character: O
Is there any other way to import those files?
If not, how can I convert them to be imported?
--jsonArray? - Pytthmongoimportis rum from operating system command prompt. The JSON data and the import command used above are fine. - prasad_