We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7.0.3
18
5
No response
when using findOneAndUpdate and arrayFilters it will not be casted, resulting in _id not being a ObjectId
introduced in 3174e29
Model.findOneAndUpdate( { _id: '636bb1a6dece391b2652ae18' }, { $set: { 'versions.$[v].test': 'test', }, }, { arrayFilters: [ { 'v._id': '637601b33ce5bbf2cbfe3831' }, ], } ).exec()
_id should be converted to ObjectId
The text was updated successfully, but these errors were encountered:
Fix Automattic#13219
aaddf3d
I have similar error with this code:
Model.findByIdAndUpdate( id, { $inc: { 'item.$[elem].items': -1 }, }, { new: true, arrayFilters: [{ 'elem._id': item._id }] }, );
Increment by -1 not working!
Sorry, something went wrong.
Merge pull request #13220 from Triple-Whale/master
f059573
Fix #13219
test: add test coverage for #13219
1ae3088
Successfully merging a pull request may close this issue.
Prerequisites
Mongoose version
7.0.3
Node.js version
18
MongoDB server version
5
Typescript version (if applicable)
No response
Description
when using findOneAndUpdate and arrayFilters it will not be casted, resulting in _id not being a ObjectId
introduced in 3174e29
Steps to Reproduce
Model.findOneAndUpdate( { _id: '636bb1a6dece391b2652ae18' }, { $set: { 'versions.$[v].test': 'test', }, }, { arrayFilters: [ { 'v._id': '637601b33ce5bbf2cbfe3831' }, ], } ).exec()
Expected Behavior
_id should be converted to ObjectId
The text was updated successfully, but these errors were encountered: