mongodb/node-mongodb-native · error · MongoParseError
Unable to make a writeConcern from journal=${value}
Error message
Unable to make a writeConcern from journal=${value} What it means
`j` is a deprecated alias for `journal`. Its transform (src/connection_string.ts:857-869) routes through `WriteConcern.fromOptions`; if that returns null it throws. Same root cause as the fsync/journal variants.
Source
Thrown at src/connection_string.ts:867
} as OptionDescriptor,
heartbeatFrequencyMS: {
default: 10000,
type: 'uint'
},
ignoreUndefined: {
type: 'boolean'
},
j: {
deprecated: 'Please use journal instead',
target: 'writeConcern',
transform({ name, options, values: [value] }): WriteConcern {
const wc = WriteConcern.fromOptions({
writeConcern: {
...options.writeConcern,
journal: getBoolean(name, value)
}
});
if (!wc) throw new MongoParseError(`Unable to make a writeConcern from journal=${value}`);
return wc;
}
} as OptionDescriptor,
journal: {
target: 'writeConcern',
transform({ name, options, values: [value] }): WriteConcern {
const wc = WriteConcern.fromOptions({
writeConcern: {
...options.writeConcern,
journal: getBoolean(name, value)
}
});
if (!wc) throw new MongoParseError(`Unable to make a writeConcern from journal=${value}`);
return wc;
}
},
loadBalanced: {
default: false,View on GitHub (pinned to 3366c21a63)
Solutions
- Replace `j` with `journal`
- Pass a full write concern object: `{ w: 'majority', journal: true }`
- Remove the option if journaling is not required
Example fix
// before
new MongoClient(uri, { j: true });
// after
new MongoClient(uri, { journal: true }); Defensive patterns
Strategy: validation
Validate before calling
// j is deprecated; prefer journal.
if ('j' in options) {
const { j, ...rest } = options;
options = { ...rest, journal: j };
} Try / catch
try {
const client = new MongoClient(uri, options);
} catch (e) {
if (e instanceof MongoParseError && /writeConcern from journal/.test(e.message)) {
// consolidate into writeConcern object and retry
} else throw e;
} Prevention
- Replace shorthand `j` with `journal`
- Keep write-concern settings in one place to avoid conflicts
- Use the writeConcern object form for clarity
When it happens
Trigger: Providing `j` where no valid WriteConcern can be formed; rare malformed write-concern combinations.
Common situations: Legacy configs using `j`; shorthand copied from older tutorials.
Related errors
- Unable to make a writeConcern from fsync=${value}
- Cannot make WriteConcern from wtimeout
- Invalid WriteConcern cannot parse: ${JSON.stringify(value)}
- Cannot set both proxyOptions and kmsConnectCallback
- Can only provide a custom AWS credential provider when the s
AI-assisted analysis of mongodb/node-mongodb-native@3366c21a63 (2026-08-04).
Data as JSON: /data/errors/ef9ae3cf90144368.json.
Report an issue: GitHub.