MongoDB – How to Add setParameter in mongod Config

configurationmongodb

When I am using setParameter in mongod config, I start mongod with error:

Unrecognized option: setParameter = enableLocalhostAuthBypass=1

How can I use setParameter from config file ?

P/S: I am using YAML config file format.

Best Answer

Here's a working example that I just tested using 2.6.6 - I specified two parameters just to show how it is done for reference:

storage:
    dbPath: "/data/db/test"
systemLog:
    destination: file
    path: "/data/db/test/mongodb.log"
processManagement:
    fork: true
setParameter:
    enableLocalhostAuthBypass: 1
    enableTestCommands: 1