node.jsmongodb-atlasmongoimport

MongoImport Throwing "Unsupported OP_Query" Error


I am trying to use mongoimport to upload a CSV file into my MongoAtlas DB. The URI connection string it gave me to use is mongoimport --uri "mongodb+srv://[user]:[password]@testing-database.nz31d.mongodb.net/myFirstDatabase?retryWrites=true&w=majority" --collection downloads --type csv --file lead-magnets.csv --headerline.

I always get this specific error that after troubleshooting I am not sure what I am missing: error inserting documents: Unsupported OP_QUERY command: insert. The client driver may require an upgrade.

I have followed their tutorials and still can not get this to work. Any advice is appreciated.


Solution

  • MongoDB now wants you to use their GUI Mongo Compass to upload directly. It is much simpler and I have to say a better process to make sure you get your data imported correctly.