Laboratory practice for the Mongo DB lecture.
install Mongo DB Comunity version form the link:
https://www.mongodb.com/try/download/community?tck=docs_server
since the new version of mongo requires the databese tools to be installed separately.
they can be found in the link:
https://www.mongodb.com/try/download/database-tools
(For Windows) Copy the files inside the forlder "bin" into the
C:\Program Files\MongoDB\Server\x.x\bin
In a CMD window on the repository folder (Mongo DB is NOT runing)
mongoimport --db test --collection movieDetails --file imdb-new.json
What is the output of the previous command?
Run Mongo DB
mongosh
or in the previous version
mongo
Access the database "test"
use test
confirm that the data set was imported properly.
db.movieDetails.count();
You should get a total of 2295 collections
now try
db.movieDetails.findOne();
Create queries to find out the requiered information:
- The cast includes either of the following actors: "Seth MacFarlane".
- The viewerRating is greater than 7.
- The mpaaRating is "R".