Importing a .bson file into Atlas

I have created a database, Restuarants through Atlas and made an empty collection, restuarants.

I connected to my Atlas account with mongosh and attempted to import a local .bson file with restore using the following command:

mongorestore -d Restaurants -c restaurants /Users/username/restaurants.sampleRestaurants.bson

However, I get the following error:

TypeError: Cannot assign to read only property ‘message’ of object 'SyntaxError: unknown: Missing semicolon. (1:15)

I can’t tell what’s wrong. Been looking through the docs but can’t really find an answer.

I had to install the mongo toolsets and was able to restore and create the collection with my data file locally, however now it’s not showing in Atlas for some reason…

Share the command you used to

and the command you used for

May be we can spot the difference between the 2 that could explained why it worked locally but not with Atlas.

1 Like