Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

What do you understand by Mendeleev's periodic table

Answered: 1 week ago