What's the differece between mongo --nodb and service mongod start?

Hi. Thank you very much for the learning material. It’s a pleasure to learn here. I am from Pakistan and just started Chapter 2.

Before the start of course, through documentation, I learnt sudo service mongod start to start MongoDB and then enter into the mongo shell. However, now it is possible to start the shell using mongo --nodb command. How both methods differ from each other?

I tried a search to find the answer but there isn’t any answer. Not even on StackOverflow!

sudo service mongod
Starts MongoDB as a service. A service runs uninterrupted in the background and automatically starts up if you reboot your machine. This is how you would want to run MongoDB in a Production environment.

mongo --nodb
Refer to the nodb option of the mongo official documentation

Both of these topics are out of scope for this course. Suggest you do the M103 Basic Cluster Admin course before looking into this.

1 Like

Big difference:

mongod is a server that provides the database, see https://docs.mongodb.com/manual/reference/program/mongod/index.html

mongo is a client that connects to mongod to access the database, see https://docs.mongodb.com/manual/reference/program/mongo/index.html

1 Like

Hi @ajbozdar,

I’m glad you found the course helpful :slight_smile: .

I hope you found the answers given by @007_jb and @steevej-1495 helpful. Please let me know if you have any other questions.

And as @007_jb mentioned above, you can take the M103 : Basic Cluster Administration course if you want to know more about these terms.

Shubham Ranjan
Curriculum Services Engineer

1 Like

Hi @Shubham_Ranjan,

I’d like to finish M001 first and be patient to get to M103 to find out more answers. Many thanks @007_jb and @steevej-1495 for your replies.

It’s a pleasure to be the part of MongoDB community.

A. J.