SyntaxError in MongoDB Shell

MongoDB Enterprise > mongo “mongodb://,,” --authenticationDatabase admin --ssl -u m121 -p aggregations --norc
uncaught exception: SyntaxError: unexpected token: string literal :

Hi @Muthukumaran_S,

You are already connected to the mongo shell as your prompt shows:
MongoDB Enterprise>

The reason for this error is that you are trying to connect to the mongo shell from within the shell itself.

You can just try to run the following commands and proceed further in the course:

  • To view the databases:

show dbs

  • To check the database that you are connected to:


  • To switch to the aggregations database:

use aggregations

  • To view collections in the current database:

show collections

Please feel free to reach out if you have any additional questions.

Kind Regards,

Thanks Sonali