How save mongod.conf for "Learning Activity: Big Bank Database Authentication" lab activity

How I can save changes to “mongod.conf”?
I tried using nano (after installing it).
The mongod.conf file is:

dbPath: /var/mongodb/db
bindIp: localhost
port: 27000
destination: file
path: /var/mongodb/logs/mongod.log
logAppend: true
fork: true
authorization: enabled

But after stopping and restarting mongod tests fail.
I think that I’m wrong in stop/start mongod anc change mongod.conf (it seems not to be changed)

Hello @Sergio_Ferlito1

I am not sure if this is a copy in and paste issue. When you post code it helps a lot when you fence it with three backticks before and after → ```

Please keep in mind that the conf files are in yaml syntax so the indentation is important. You may have this but it is not visible in your post.

In case you have this correct please review chapter 1 to understand the stop and start. If you still have problems please show us the command you used and the error you get.

Finally you can use vi as editor which is installed on almost all unix machines
vi <path>/mongod.conf
press i to change to edit mode
change your code
<ESC> to leave the edit mode
:wq to write and quit


You are supposed to use IDE for this course
No need of using vi.Just use editor area to make changes to your config file

Seems you are trying it on your local host?

1 Like

Finally solved, thanks.