DBS311 Lab 9 – MongoDB – UPDATE

$30.00

Download Details:

  • Name: Lab-9-pb8xrz.zip
  • Type: zip
  • Size: 702.34 KB

Category:

Description

Rate this product

Tasks

  1. Write an update statement to add new fields program and term to all documents in the students collection and set them to values “CPA” and 1.
 

 

 

  1. Write an update statement to modify the value of the program field to “BTM” for all documents in the students

 

 

 

 

 

  1. Write an update statement to modify the value of the program field to “CPA” for the student named Jonie Raby.

Before executing an update statement or a delete statement, you can use the find() method with the update or delete criteria, to see how many documents will be affected.

Write the update statement in the box below.

 

 

 

How many documents are there with the value Jonie Raby for the name field? _______

How many documents were updated? ________

 

  1. Write a query to show only the program field for the document that the value of the filed name is Jonie Raby.

 

 

 

 

 

 

 

 

  1. Write an update statement to increase the value of the term field by 2 for documents with _id 20, 22, and 24.

 

 

 

 

 

 

 

  1. Write an update statement to remove the term field from documents that the value of the term filed is 3.