Now that you've learned some of the basics of querying MongoDB via the mongo shell, use that information to query a collection of bios. Remember to switch off with your partner half-way through this exercise.
- Start the MongoDB server with
mongod
. - In another terminal window, start the Mongo shell with
mongo
. - Create a new database called
challenge
. - Create a collection called
bios
in the new database. - Insert the records from the
bios.bson
file into thebios
collection. NOTE: you should be able to copy/paste the entire array into the appropriate collections method.
- Create a file,
queries.bson
that will contain the queries that correctly address the criteria in the steps that follow. - Find documents that have awards.
- Find documents that don't have awards.
- Find documents that have contribs for OOP or UNIX.
- Find documents with "Turing Award" awards.
- Find documents with IDs between 3 and 7.
- Find documents with awards that were awarded before the year 2000.
- Find documents with birth dates, but no death dates.