December 2018
Beginner
826 pages
22h 54m
English
Once installed, you can start and enable MongoDB with the mongod daemon:
$ sudo systemctl enable --now mongod
By default, MongoDB will start on localhost port 27017, but confirm this using ss or other tools:
$ ss -a '( sport = :27017 )'State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 127.0.0.1:27017 *:*
Once started, you can connect to your database using the mongo command-line tool:
$ mongo
The output of the preceding command is as follows:

Note that we connected to test by default. We can confirm what DB we're connected to (if we missed the notification) with the db command:
> dbtest
We can change databases ...
Read now
Unlock full access