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
length
When try to set length field to the document I have N null fields. Tried findOneAndUpdate and update methods.
findOneAndUpdate
update
const setLength = async () => { const _id = {your_id}; const length = 20; // Note: only for number, string works as expected await db.collection.findOneAndUpdate({_id}, {$set: {length: length}}); } setLength()
expected result:
db.collection.findOne({_id}) { _id: {your_id}, length: 20 }
sad reality:
db.collection.findOne({_id}) { _id: {your_id}, "0" : null, "1" : null, "2" : null, "3" : null, "4" : null, "5" : null, "6" : null, "7" : null, "8" : null, "9" : null, "10" : null, "11" : null, "12" : null, "13" : null, "14" : null, "15" : null, "16" : null, "17" : null, "18" : null, "19" : null }
The text was updated successfully, but these errors were encountered:
Sorry to bother you. We've added a custom middleware that modifies $set body on update. Be careful with custom middlewares!
Sorry, something went wrong.
No branches or pull requests
When try to set
length
field to the document I have N null fields. TriedfindOneAndUpdate
andupdate
methods.expected result:
sad reality:
The text was updated successfully, but these errors were encountered: