Update Multiple Array Elements Using greaterthanorequal lessthanorequal in Mongo: Updating multiple elements in Array data type in MongoDB using the shell.

We have 2 documents in MongoDB like below

now we want to update grades value of which are greater than or equal to 100 is the Query for updating multiple elements in Array.

In the above Query all the elements which are greater than or equal 100 are replaced with 80 we have a list of operators show here and dummy_collection is my Collection name.

Also Read: How to Update Arrays Element in MongoDB

Update Multiple Array Elements Using greaterthanorequal lessthanorequal in Mongo

Leave a Reply

Your email address will not be published. Required fields are marked *