Question

Assignment 1: Intro to MongoDB

For this assignment, I want you to do the following operations in a MongoDB database. For some of

these, you may have to refer to MongoDB's operator documentation. This is one of the most

important assignments in this section, make sure you answer all questions and take notes for future

assignments.

1. Create a database called 'my_first_db'.

2. Create students collection.

3. Each document you insert into this collection should have the following format: ({name:

STRING, home_state: STRING, lucky number: NUMBER, birthday: (month: NUMBER, day:

NUMBER, year: NUMBER}})

4. Create 5 students with the appropriate info.

5. Get all students.

6. Retrieve all students who are from California (San Jose Jessup Campus).

7. Get all students whose lucky number is:

1. greater than 3

2. less than or equal to 10

3. between 1 and 9 (inclusive)

8. Add a field to each student collection called interests' that is an ARRAY. It should contain

the following entries: 'coding', 'bible', 'MongoDB'. Do this in ONE operation.

9. Add some unique interests for each particular student into each of their interest arrays.

10. Add the interest 'taxes' into someone's interest array.

11. Remove the 'taxes' interest you just added.

12. Remove all students who are from California.

13. Remove a student by name.

14. Remove a student whose lucky number is greater than 5 (JUST ONE)

15. Add a field to each student collection called 'number_of_experience' and set it to 0.

16. Rename the 'number_of_experience' field to 'year_experience'./nAssignment 1: Survey Form

Survey Form

Ox http://localhost

Your Name

Ben Mandakh

Location:

San Jose

Favorite Language: Javascript

Comment (optional):

Coding is great Covid 19 is Not!

Submit

OX

Survey Form

http://localhost/result

Submitted Information

Name: Ben Manda

Location: San Jose

Favorite Language: Javascript

Comment Coding is great! Covid 19 is Not

Go Back

Create a survey form. Before you start coding this, first outline or write down the steps of

accomplishing this.

For example

1. Have the server render views/index.ejs that has the form for the user to fill out

2. The user fills out the form and submits

3. The submitted form gets sent to /result

4. The server recognizes when someone posts things to /result, grabs information from the

POST, and sends the POST data back as it renders views/results.ejs

Question image 1Question image 2Question image 3