Why was this answer incorrect?

So I was going through the final m103 exam and I got the following answer wrong:

  1. mongod --dbpath /data/db --fork

Question was: Which of the following are valid command line instructions to start a mongod? You may assume that all specified files already exist.

Now, I might have missed something on this, but I don’t understand why the above is not going to work, while the following one is correct:

  1. mongod --logpath /var/log/mongo/mongod.log --dbpath /data/db --fork

Anyone who can tell me why (1) is incorrect, while (2) is correct?

When you are unsure always refer to the documentation.


And if you try

you will get something like

BadValue: --fork has to be used with --logpath or --syslog

1 Like

Thank you, appreciate your answer! I checked the documentation at --fork but did not actually try running the commmands.

Could be worth mentioning this in the --fork section of the documentation :grinning:

I completely agree.

Hi @Daniele_Molinari,

You can actually share your feedback in the documentation itself.

At the bottom, you will see an option called Was this page helpful? .

Click on either Yes or No and share your feedback with us.

~ Shubham