Company
Date Published
Author
Alex Bevilacqua
Word count
640
Language
English
Hacker News points
None

Summary

The MongoDB Node.js driver version 6.0.0 is set to release in August 2023 and brings changes to the findOneAnd* APIs, which were previously returning a ModifyResult instead of the requested document. A new FindOneAnd*Options property called includeResultMetadata has been introduced, allowing users to control whether the returned result includes metadata or not. By setting this option to false, users can now access the requested document as expected. The Node.js driver version 5.7.0+ already supports this new behavior, and it will become the default in version 6.0.0, requiring users to set includeResultMetadata: true if they need to access the ModifyResult directly.