Question: MongoDB Powershell Commands / / Step 1 : Create a database named restaurantsDB, create a collection named restaurants, and insert document 1 in lab 1

MongoDB Powershell Commands
//Step 1: Create a database named restaurantsDB, create a collection named restaurants, and insert document 1 in lab1.data.txt into the collection.
//Note: You do NOT need to write commands to create the database and collection,
//The script in lab1.exectute.ps1 will automatically create the datavase restaurantsDB and the collection restaurants
//You only need to write an insertOne command to insert the document into the collection restaurants
//Write your command(s) to finish step 1 after this line
//Step 2: Insert document 2,3 in lab1.data.txt into the collection using insertMany command.
//Step 3: Update a restaurant's cuisine from "Bakery" to "American".
//Step 4: Update the restaurant name from "Wendy'S" to "Panda Express" and insert a new field "city": "Chicago" into the "addreess" field.
//Step 5: For each restaurant, update the second score of that restaurant to 5.
//Drop the collection restaurants from database restaurantsDB
db.restaurants.drop()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!