Here is my json file :
{"a":"b"}
When i am importing this file in database by this command:
mongoimport --db test --collection abc --jsonArray --file ABC.json
I got this error :
2016-11-10T15:03:39.696+0530 connected to: localhost
2016-11-10T15:03:39.697+0530 Failed: error reading separator after document #1: bad JSON array format - found no opening bracket '[' in input source
2016-11-10T15:03:39.697+0530 imported 0 documents
in my console.
There is no '[' symbol in my file. Can someone tell me where i am wrong?
Since you included the option --jsonArray
, you must provide an array: [{"a":"b"}]
.
If you provide a single document, do not use the option --jsonArray
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With