We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b23bb0 commit ff4dc7dCopy full SHA for ff4dc7d
src/operations/update.ts
@@ -241,8 +241,8 @@ export class ReplaceOneOperation extends UpdateOperation {
241
if (res.writeErrors) throw new MongoServerError(res.writeErrors[0]);
242
243
return {
244
- acknowledged: this.writeConcern?.w !== 0 ?? true,
245
- modifiedCount: res.nModified != null ? res.nModified : res.n,
+ acknowledged: this.writeConcern?.w !== 0,
+ modifiedCount: res.nModified ?? res.n,
246
upsertedId:
247
Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null,
248
upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0,
0 commit comments