user2085368
user2085368

Reputation: 725

The MongoDB docs say my config file should be YAML. It's not. Why?

I'm using MongoDB 2.6 wherein the docs clearly state the config file is YAML.

When I go to open my config, /etc/mongod.conf, it looks like this one in the github repo (which is also MongoDB 2.6)

What gives, and how do I configure my server when the docs don't match the deployed default config, at all?

Upvotes: 10

Views: 2274

Answers (1)

John Petrone
John Petrone

Reputation: 27497

Well, the new format is YAML, but 2.6 still supports the old format:

The 2.4 configuration file format remains for backward compatibility.

You can find documentation on the old format here and as you have discovered, there are far more examples out there of the old format then on the new YAML based one. I'm not aware of anything that you can do in the new format that you can't do in the old. And I'm aware of a number of people struggling to configure the new YAML format due to few examples being available and the touchiness of the new format to spacing/tabs/etc.

Personally I'm still using the old format and will continue to do so until I see a compelling reason to switch.

Here's the docs on the old format:

http://docs.mongodb.org/v2.4/reference/configuration-options/

Upvotes: 8

Related Questions