Given the following documents in an "employee" collection,

{_id:1, ename:"Anand", salary:46000, desg:"TA", rating:4}

{_id:2, ename:"Vivek", salary:44000, desg:"TA", rating:5}

{_id:3, ename:"Sara", salary:86000, desg:"PM", rating:4}

{_id:4, ename:"Karthik", salary:70000, desg:"Architect", rating:4}

{_id:5, ename:"Anahi", salary:42000, desg:"Analyst", rating:4}

What is the result of executing the following operation?

db.employee.update( { desg:"TA", rating: { $gt:4} }, { $set: { role change:"Sr.TA"} , $inc: { salary: 10000 } } )

Updates the documents of the collection whose desg is "TA" and who has obtained rating greater than 4, by incrementing the salary to 10000
Updates the documents of the collection whose desg is "TA" and who has obtained rating greater than 4, by incrementing the salary by 10000 and adds a new field 'role change' with a value "Sr.TA"
Updates only the first found document where desg is "TA" and rating greater than 4, by incrementing the salary by 10000 and also adds a new field 'role change' with a value "Sr. TA"
Results in an error
Verified Answer
Correct Option - c

To get all Infosys Certified Mongo Developer Exam questions Join Telegram Group https://bit.ly/infy_premium_group

Telegram

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in

Updated on Thu, 31 Jul 2025