Search code examples
mongodbjournalingnosql

Mongo - What does WriteConcern j option do when journaling is turned off?


The documentation is not clear on what happens when the Write Concern j Option is set to true and mongod is running without a journal. Does this indicate that the write operation will return after it has been acknowledged to have been committed to the database? OR can the write operation return before the write is committed to the database? Am I thinking about this incorrectly?


Solution

  • You're thinking about it correctly. From the documentation:

    Changed in version 2.6: Specifying a write concern that includes j: true to a mongod or mongos running with --nojournal option produces an error. Previous versions would ignore the j: true.

    One can only assume that you will get some sort of error while trying to set it up as described.