Mongo Shell By Example

Start the mongo shell

Start the mongo shell by running mongo

Note: this will connect using the default port 27017. Use -p for specifying a different port.

You should get an output similar to the following

MongoDB shell version v4.0.3
connecting to: mongodb://127.0.0.1:27017
Implicit session: session { "id" : UUID("2323-8as8-23aa-8fsa") }
MongoDB server version: 4.0.3
>

From this moment on, everything you’ll type will be executed in the mongo shell.

Continue reading “Mongo Shell By Example”