Laboratory Exercise CRUD Operation
Laboratory Exercise CRUD Operation
Using Mongo shell, create a database named MongoLab1 and insert the documents below into the
employees collection.
2. Remove all the “ReportingTo” field in employees collection where its value is null.
3. Using the $inc operator, update all the documents by increasing their salary by 5000.
4. Update the document of “Reg Rubio” and “Ian Tayao” by adding the “President” to their Reporting
field.
5. Find the document where their salary is above “21,000.00”.
6. Find the document where their name starts with “S” and “R”.
8. Update all the document by adding a sub-document named “contact” with a key-value, “email”:
“[email protected]” (Example: [email protected]) and “phone”: “+1 1234567” (note: +1 value should
depend on their rank number).