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.
includeResultMetadata: true
findOneAndUpdate()
1 parent b85fb3b commit 4717ae6Copy full SHA for 4717ae6
CHANGELOG.md
@@ -5,6 +5,8 @@
5
### Fixed
6
- Do not pass `writeOptions` in database calls.
7
- Use proper `"returnDocument": "after"` option w/`findOneAndUpdate`.
8
+- Pass `includeResultMetadata: true` to `findOneAndUpdate` to ensure meta data
9
+ is always returned.
10
11
## 22.1.1 - 2025-03-04
12
lib/documents.js
@@ -637,7 +637,8 @@ export async function _refresh({
637
query, update, {
638
projection,
639
returnDocument: 'after',
640
- promoteBuffers: true
+ promoteBuffers: true,
641
+ includeResultMetadata: true
642
});
643
// return whether update occurred and new record if it did
644
return {updated: result.lastErrorObject.n !== 0, record: result.value};
0 commit comments