Question: USING MONGODB I need to use the db.collection.updateMany() method on the inventory collection to update all documents where qty is less than 50. My code
USING MONGODB
I need to use the db.collection.updateMany() method on the inventory collection to update all documents where qty is less than 50.
My code is:
db.inventory.updateMany({ "qty": { $lt: 50 } },{$set: { "size.uom": "in", status: "P" }, "currentDate": { "lastModified": true }})
however, I keep getting this error:
MongoServerError: Unknown modifier: currentDate. Expected a valid update modifier or pipeline-style update specified as an array
Please help :)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
