Skip to content

Commit ff4dc7d

Browse files
committed
nullish coalescing
1 parent 1b23bb0 commit ff4dc7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/operations/update.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ export class ReplaceOneOperation extends UpdateOperation {
241241
if (res.writeErrors) throw new MongoServerError(res.writeErrors[0]);
242242

243243
return {
244-
acknowledged: this.writeConcern?.w !== 0 ?? true,
245-
modifiedCount: res.nModified != null ? res.nModified : res.n,
244+
acknowledged: this.writeConcern?.w !== 0,
245+
modifiedCount: res.nModified ?? res.n,
246246
upsertedId:
247247
Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null,
248248
upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0,

0 commit comments

Comments
 (0)