Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started