{"record":{"id":"ef9ae3cf90144368","repo":"mongodb/node-mongodb-native","slug":"unable-to-make-a-writeconcern-from-journal-value","errorCode":null,"errorMessage":"Unable to make a writeConcern from journal=${value}","messagePattern":"Unable to make a writeConcern from journal=(.+?)","errorType":"exception","errorClass":"MongoParseError","httpStatus":null,"severity":"warning","filePath":"src/connection_string.ts","lineNumber":867,"sourceCode":"  } as OptionDescriptor,\n  heartbeatFrequencyMS: {\n    default: 10000,\n    type: 'uint'\n  },\n  ignoreUndefined: {\n    type: 'boolean'\n  },\n  j: {\n    deprecated: 'Please use journal instead',\n    target: 'writeConcern',\n    transform({ name, options, values: [value] }): WriteConcern {\n      const wc = WriteConcern.fromOptions({\n        writeConcern: {\n          ...options.writeConcern,\n          journal: getBoolean(name, value)\n        }\n      });\n      if (!wc) throw new MongoParseError(`Unable to make a writeConcern from journal=${value}`);\n      return wc;\n    }\n  } as OptionDescriptor,\n  journal: {\n    target: 'writeConcern',\n    transform({ name, options, values: [value] }): WriteConcern {\n      const wc = WriteConcern.fromOptions({\n        writeConcern: {\n          ...options.writeConcern,\n          journal: getBoolean(name, value)\n        }\n      });\n      if (!wc) throw new MongoParseError(`Unable to make a writeConcern from journal=${value}`);\n      return wc;\n    }\n  },\n  loadBalanced: {\n    default: false,","sourceCodeStart":849,"sourceCodeEnd":885,"githubUrl":"https://github.com/mongodb/node-mongodb-native/blob/dce7939f86fb283e167ad709955abedb7bf23124/src/connection_string.ts#L849-L885","documentation":"`j` is a deprecated alias for `journal` (descriptor: `deprecated: 'Please use journal instead'`). The transform at src/connection_string.ts:860 builds a WriteConcern from `{...options.writeConcern, journal: getBoolean(name, value)}`; if WriteConcern.fromOptions returns falsy, MongoParseError is thrown at src/connection_string.ts:867. getBoolean rejects non-boolean values first.","triggerScenarios":"Passing `j: true` in a writeConcern combination that yields no usable WriteConcern object; or routing `j` through config tooling that drops the sibling writeConcern fields needed by fromOptions.","commonSituations":"Using the short `j` alias from older tutorials; layering `j` on top of an existing `writeConcern` object whose keys conflict; partial config merging that leaves fromOptions nothing to build.","solutions":["Use `journal: true` (the canonical name) instead of `j: true`.","Consolidate into one `writeConcern: { w: 'majority', journal: true }` object.","Verify the merged options object still contains a valid w/journal/wtimeoutMS combination before construction."],"exampleFix":"// before\nnew MongoClient(uri, { j: true });\n\n// after\nnew MongoClient(uri, { journal: true });","handlingStrategy":"validation","validationCode":"if ('j' in opts) {\n  console.warn('j is deprecated; use journal instead');\n  opts.journal = Boolean((opts as any).j);\n  delete (opts as any).j;\n}","typeGuard":"null","tryCatchPattern":"try { client = new MongoClient(uri, opts); } catch (e) { if (e instanceof MongoParseError && /journal/.test(e.message)) { opts.journal = (opts as any).j; delete (opts as any).j; client = new MongoClient(uri, opts); } else throw e; }","preventionTips":["Use the canonical `journal` option, not the `j` alias.","Keep all write-concern knobs inside a single `writeConcern` object.","Codify the option names in a shared config schema."],"tags":["write-concern","deprecated","configuration"],"backgroundTag":null,"analyzedSha":"dce7939f86fb283e167ad709955abedb7bf23124","analyzedAt":"2026-08-11T04:54:53.215Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}