[go: up one dir, main page]

0% found this document useful (0 votes)
15 views2 pages

Mongo DBExercise

The document outlines creating a database with movies and users collections. It provides sample structures and queries to find documents matching certain criteria.

Uploaded by

ram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Mongo DBExercise

The document outlines creating a database with movies and users collections. It provides sample structures and queries to find documents matching certain criteria.

Uploaded by

ram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Exercise : 1

Create a database for movies

- Collection - movies

- Collection - users

Movies Collection

- name, imdb_rating, release date, genres : [],

description : {summary : "...", star : [], directors : []}

release_date : new Date("2021-8-12")

- Insert at least 10 documents

Users Collection

- name, emailId,

movies_watched : {count : 2, names : ["Avengers", "Thor"],

"rating" : [7.8, 8.9],

"review" : ["Good", "Amazing"]}

- Insert at least 5 documents

Queries

- Find all movies directed by "XYZ".

- Find movies whose rating is above 8.0

- Find movies whose genre is action and comedy

- Find movies whose genre is only action

- Find movies whose review contains positive(good/best/awesome..) words

- Find users who has watched more than 2 movies

- Find users who has given 8 rating to Avengers Movies

- Find users who has watched only 1 movie till now.

- Find movies whose imdb rating is not greater than 8


- Find movies where either imdb rating is above 8 or genre is action

- Find movies where rating is above 8 and actor is "XYZ"

- Find movies where summary contains word "power"

- Find reviews from users collection where review contains bad words

You might also like