Project tasks
Build a MongoDB database of people and phone numbers. Display the result of each task.
- create a database containing the test data
- add several other people to the database. (John Doe, Betty Boop, and Jonathan L. Seagull)
- add an age field to
- John Doe age 45
- Arleen Pete age 21
- John Seagull age 40
- count the entries; display the count
- delete Betty Boop
- search the database/collection for
- every entry
- every entry with the last name Pete
- every entry over the age of 40
- every entry under the age 42
- every entry with the phone prefix 626
- every entry without a phone number
- every entry entry with no last name
- every entry who's last name field has the letter 't' in it
- add 5 to Jonathan L. Seagull's age
- delete every entry with the last name of Pete
- delete the collections "xyz" and "phones"
- delete the database
If using Linux and mongo shell, create Bash scripts to do the tasks?
Hints
When using the mongo shell, write/edit
commands in a text editor. Then copy and paste them into the command shell.
This will make changes and corrections easier to do.
Test data
First Name | Last Name | Nickname | Phone Number |
Tommy | Rot | | 666-555-8888 |
Judy | Zed | Z | 626-555-9999 |
Piccolo | Pete | | 626-555-1234 |
Arleen | Pete | Buttercup | |