"No viable alternative at input" error running mongodump in Intellilshell

I am attempting to run a mongodump command in IntelliShell to provide some ino for Atlas support, and using the command they gave me, I get a ton of errors saying "no viable alternative at input` for every field.

mongodump --uri="mongodb+srv://govtribe0-shard-00-00.oolsu.mongodb.net" --excludeCollection="system.sessions" --excludeCollection="transaction_coordinators" --excludeCollection="system.indexBuilds" --excludeCollection="image_collection" --excludeCollection="system.preimages" --username myusername --password mypassword --gzip --archive=config-SERVER_VERSION.g

First, can I run mongodump copmmands in IntelliShgell?

Second, what is sytactically wrong with the command above as I’m running it?

Welcome to the community!

The IntelliShell adds a set of features on top of the regular Mongo Shell (mongosh). It expects JavaScript input which is then executed against the target MongoDB server. What you’re trying to run is a non-Mongo shell command and not valid JavaScript, which is why you’re getting the syntax errors.

If you want to run the command as specified, you’d have to run it from your system’s command line/terminal/shell. Alternatively, you can also use Studio 3T’s export feature to export a database or collection using mongodump: How to Export MongoDB to CSV, Excel, JSON, SQL & BSON/mongodump

Let me know if this helps. :slight_smile:

1 Like