Hi to everyone,
I’m traing to import this simple document that i found at this link . I have created a file .json by coping this code:{ "_id": "joe", "name": "Joe Bookreader", "addresses": [ { "street": "123 Fake Street", "city": "Faketon", "state": "MA", "zip": "12345" }, { "street": "1 Some Other Street", "city": "Boston", "state": "MA", "zip": "12345" } ] }
Than i have imported this file in compass (like the documentation explain at this link), but when i upload the data, this error appear:
Operation passed in cannot be an Array
I don’t understan why. MongoDB should be optimizered for nested documents…
Anyone can help me please?
I created a blank test.json file and I copied the data from the question. I then opened Compass and clicked “ADD DATA” → “Import File” → “BROWSE” → “IMPORT”.
With this type of structure i have the error, but if i create a .json file with Blocknote and the following structure :{ "_id": "joe", "name": "Joe Bookreader", "addresses": [ { "street": "123 Fake Street", "city": "Faketon", "state": "MA", "zip": "12345" }, { "street": "1 Some Other Street", "city": "Boston", "state": "MA", "zip": "12345" } ] } the error disappear.