Assignment-3(2)
Assignment-3(2)
Set A:
1. Create a database with the name ‘Movie’.
A ‘Film’ is a collection of documents with the following fields:
a. Film Id
b. Title of the film
c. Year of release
d. Genre / Category (like adventure, action, sci-fi, romantic etc.) A film can belong to
more than one genre.
e. Actors (First name and Last name)
f. Director (First name and Last name)
g. Release details (It consists of places of release, dates of release and rating of the film.)
Queries:
1. Insert at least 10 documents in the collection Film – a. Insert at least one document
with film belonging to two genres.
b. Insert at least one document with film that is released at more than one place and on
two different dates.
c. Insert at least three documents with the films released in the same year.
d. Insert at least two documents with the films directed by one director.
e. Insert at least two documents with films those are acted by a pair ‘Madhuri Dixit’ and
‘Shahrukh Khan’.
Make sure, you are inserting the names of actors who have acted in films, given in the ‘Film’
collection.
3. Display all the documents inserted in both the collections.
4. Add a value to the rating of the film whose title starts with ‘T’.
5. Add an actor named " " in the ‘Actor’ collection. Also add the details of the film in ‘Film’
collection in which this actor has acted in.
6. Delete the film " ".
7. Delete an actor named " ".
8. Delete all actors from an ‘Actor’ collection who have age greater than “ ”
9. Update the actor’s address where Actor Id is “ ”.
10. Update the genre of the film directed by “ ”.
Set B:
Set C:
Consider the following document in the students collection whose grades element value
is an array of embedded documents:
{
_id: 4,
grades: [ 36
{ grade: 80, mean: 75, std: 8 },
{ grade: 85, mean: 90, std: 5 },
{ grade: 85, mean: 85, std: 8 }
]
}
1. Update the std field of the first array element that matches the grade equal to 85
2. Delete array element with grade 80