Why am I getting a parser error in my YAML configuration in MongoDB --Install

I am trying to install a service for Mongodb. I type the following command in cmd window as administrator

c:/mongodb/bin/mongod.exe --config "C:\mongodb\mongod.cfg" --install, 

but I get the following error:

YAML parsing error: YAML-cpp: error on line 2, column 13: illegal map value

Here is the contents of the configuration file:

systemLog:
    destination: file
    path: c:\data\log\mongod.log
storage:
    dbPath: c:\data\db
+4
source share
1 answer

Well, note that YAML doesn't actually satisfy tabs, and then uses space instead of destination and storage. Remember to add a space after each ":" even in the lines of systemLog and storage Finally, use quotation marks to enclose your tracks and double backslashes in these tracks.

Try:

systemLog:
 destination: file
 path: "c:\\data\\log\\mongod.log"
storage:
 dbPath: "c:\\data\\db"
+10
source

All Articles