- Create a database
assignment1
and insert the following into a collection calledmovies
[
{
"title": "Fight Club",
"writer": "Chuck Palahniuk",
"year": 1999,
"actors": ["Brad Pitt", "Edward Norton"]
},
{
"title": "Pulp Fiction",
"writer": "Quentin Tarantino",
"year": 1994,
"actors": ["John Travolta", "Uma Thurman"]
},
{
"title": "Inglorious Basterds",
"writer": "Quentin Tarantino",
"year": 2009,
"actors": ["Brad Pitt", "Diane Kruger", "Eli Roth"]
},
{
"title": "The Hobbit: An Unexpected Journey",
"writer": "J.R.R. Tolkien",
"year": 2012,
"franchise": "The Hobbit"
},
{
"title": "The Hobbit: The Desolation of Smaug",
"writer": "J.R.R. Tolkien",
"year": 2013,
"franchise": "The Hobbit"
},
{
"title": "The Hobbit: The Battle of the Five Armies",
"writer": "J.R.R. Tolkien",
"year": 2012,
"franchise": "The Hobbit",
"synopsis": "Bilbo and Company are forced to engage in a war against an array of combatants and keep the Lonely Mountain from falling into the hands of a rising darkness."
},
{
"title": "Pee Wee Herman's Big Adventure"
},
{
"title": "Avatar"
}
]
Now give the queries to answer the following questions
- List out all the movie names
- Details of movies written by "Quentin Tarantino"
- Name and year of movies in which "Brad Pitt" acted
- Movies from "The Hobbit" franchise
- Movies released in the 90s
- Movies releasted before 2000 or after 2010
- Add the follwing synopsis to "The Hobbit: An Unexpected Journey" -
"A reluctant hobbit, Bilbo
Baggins, sets out to the Lonely Mountain with a spirited group of dwarves to reclaim their mountain home - and the gold within it - from the dragon Smaug."
- Add the follwing synopsis to "The Hobbit: The Desolation of Smaug" -
"The dwarves, along with Bilbo Baggins and Gandalf the Grey, continue their quest to reclaim Erebor, their homeland, from Smaug. Bilbo Baggins is in possession of a mysterious and magical ring."
-
Add an actor named
Samuel L. Jackson
to the moviePulp Fiction
-
Find all movies that have a synopsis that contains:
- the word "Bilbo"
- the word "Gandalf"
- the word "Bilbo" but not the word "Gandalf"
- the words "dwarves" or "hobbit"
- the words "gold" and "dragon"
-
Remove the records from the collection where the movie title is:
- "Pee Wee Herman's Big Adventure"
- "Avatar"