To start the shell, run the
$ mongo MongoDB shell version: 3.0.3 connecting to: test
The shell automatically attempts to connect to a running MongoDB server on startup, so make sure you start mongod before starting the shell.
If no other database is specified on startup, the shell selects a default database called
test. As a way of keeping all the subsequent tutorial exercises under the same namespace, let's start by switching to the
sampledb database: ...