[
{
"title": "The Matrix",
"director": "Lana Wachowski",
"year": 1999,
"genre": ["Sci-Fi", "Action"],
"rating": 8.7,
"runtime": 136,
"cast": ["Keanu Reeves", "Laurence Fishburne", "Carrie-Anne Moss"],
"isOscarWinner": true,
"boxOffice": 463.5,
"streamingOn": ["Netflix", "Amazon Prime"],
"languages": ["English", "Spanish", "French"]
},
{
"title": "Inception",
"director": "Christopher Nolan",
"year": 2010,
"genre": ["Sci-Fi", "Action", "Thriller"],
"rating": 8.8,
"runtime": 148,
"cast": ["Leonardo DiCaprio", "Joseph Gordon-Levitt", "Ellen Page"],
"isOscarWinner": true,
"boxOffice": 836.8,
"streamingOn": ["Netflix"],
"languages": ["English", "Japanese"]
},
{
"title": "The Dark Knight",
"director": "Christopher Nolan",
"year": 2008,
"genre": ["Action", "Crime", "Drama"],
"rating": 9.0,
"runtime": 152,
"cast": ["Christian Bale", "Heath Ledger", "Aaron Eckhart"],
"isOscarWinner": true,
"boxOffice": 1004.6,
"streamingOn": ["HBO Max", "Amazon Prime"],
"specialFeatures": {
"behindTheScenes": true,
"commentary": true,
"deletedScenes": true
}
},
{
"title": "Memento",
"director": "Christopher Nolan",
"year": 2000,
"genre": ["Mystery", "Thriller"],
"rating": 8.4,
"runtime": 113,
"cast": ["Guy Pearce", "Carrie-Anne Moss"],
"boxOffice": 39.7
},
{
"title": "Interstellar",
"director": "Christopher Nolan",
"year": 2014,
"genre": ["Sci-Fi", "Drama", "Adventure"],
"rating": 8.6,
"runtime": 169,
"cast": ["Matthew McConaughey", "Anne Hathaway"],
"isOscarWinner": true,
"boxOffice": 701.7,
"streamingOn": ["Netflix", "Paramount+"],
"specialFeatures": {
"behindTheScenes": true,
"commentary": false,
"deletedScenes": false
}
},
{
"title": "The Shawshank Redemption",
"director": "Frank Darabont",
"year": 1994,
"genre": ["Drama"],
"rating": 9.3,
"runtime": 142,
"cast": ["Tim Robbins", "Morgan Freeman"],
"boxOffice": 58.3,
"languages": ["English", "French"]
},
{
"title": "Alien",
"director": "Ridley Scott",
"year": 1979,
"genre": ["Horror", "Sci-Fi"],
"rating": 8.5,
"runtime": 117,
"cast": ["Sigourney Weaver", "Tom Skerritt"],
"isOscarWinner": true,
"boxOffice": 104.9
},
{
"title": "Jurassic Park",
"director": "Steven Spielberg",
"year": 1993,
"genre": ["Action", "Sci-Fi", "Adventure"],
"rating": 8.7,
"runtime": 127,
"cast": ["Sam Neill", "Laura Dern", "Jeff Goldblum"],
"isOscarWinner": true,
"boxOffice": 914.7,
"streamingOn": ["Netflix", "Amazon Prime"],
"specialFeatures": {
"behindTheScenes": true,
"commentary": true,
"deletedScenes": true
}
},
{
"title": "Pulp Fiction",
"director": "Quentin Tarantino",
"year": 1994,
"genre": ["Crime", "Drama"],
"rating": 8.9,
"runtime": 154,
"cast": ["John Travolta", "Samuel L. Jackson", "Uma Thurman"],
"isOscarWinner": true,
"boxOffice": 213.9,
"languages": ["English", "Spanish", "French"]
},
{
"title": "The Godfather",
"director": "Francis Ford Coppola",
"year": 1972,
"genre": ["Crime", "Drama"],
"rating": 9.2,
"runtime": 175,
"cast": ["Marlon Brando", "Al Pacino", "James Caan"],
"isOscarWinner": true,
"boxOffice": 245.1,
"languages": ["English", "Italian"]
},
{
"title": "Avatar",
"director": "James Cameron",
"year": 2009,
"genre": ["Action", "Sci-Fi", "Adventure"],
"rating": 7.8,
"runtime": 162,
"cast": ["Sam Worthington", "Zoe Saldana", "Sigourney Weaver"],
"boxOffice": 2847.2,
"streamingOn": ["Disney+", "Amazon Prime"],
"specialFeatures": {
"behindTheScenes": true,
"commentary": true,
"deletedScenes": true
}
},
{
"title": "The Silence of the Lambs",
"director": "Jonathan Demme",
"year": 1991,
"genre": ["Crime", "Thriller"],
"rating": 8.6,
"runtime": 118,
"cast": ["Jodie Foster", "Anthony Hopkins"],
"isOscarWinner": true,
"boxOffice": 272.7
},
{
"title": "Gladiator",
"director": "Ridley Scott",
"year": 2000,
"genre": ["Action", "Drama"],
"rating": 8.5,
"runtime": 155,
"cast": ["Russell Crowe", "Joaquin Phoenix", "Connie Nielsen"],
"isOscarWinner": true,
"boxOffice": 460.6,
"specialFeatures": {
"behindTheScenes": true,
"commentary": true,
"deletedScenes": true
}
},
{
"title": "The Lord of the Rings: The Fellowship of the Ring",
"director": "Peter Jackson",
"year": 2001,
"genre": ["Action", "Adventure", "Fantasy"],
"rating": 8.8,
"runtime": 178,
"cast": ["Elijah Wood", "Ian McKellen", "Viggo Mortensen"],
"isOscarWinner": true,
"boxOffice": 897.7,
"streamingOn": ["HBO Max", "Netflix", "Amazon Prime"],
"languages": ["English", "Spanish", "French", "German"]
},
{
"title": "Forrest Gump",
"director": "Robert Zemeckis",
"year": 1994,
"genre": ["Drama", "Romance"],
"rating": 8.8,
"runtime": 142,
"cast": ["Tom Hanks", "Robin Wright", "Gary Sinise"],
"isOscarWinner": true,
"boxOffice": 678.2,
"streamingOn": ["Netflix", "Paramount+"],
"languages": ["English", "French"]
}
]
=> db.movies.find({runtime:{$gt:150}},{title:1,_id:0})
=> db.movies.find({rating:{$gt:8.5}},{title:1,_id:0})
=> db.movies.find({year:{$gte:2000,$lte:2015}},{title:1,_id:0})
=> db.movies.find({$or:[{boxOffice:{$lte:500}},{boxOffice:{$gte:1000}}]},{title:1,_id:0})
=> db.movies.find({$and:[{director:"Christopher Nolan"},{isOscarWinner: true },{boxOffice:{$gt:700}},{streamingOn:"Netflix"}]})
=> db.movies.find({"specialFeatures.behindTheScenes":true,"specialFeatures.deletedScenes":true})
=> db.movies.find({cast:{$in:["Carrie-Anne Moss","Morgan Freeman"]},languages:{$exists:true,$not:{$size:0}},streamingOn:{$exists:true,$not:{$size: 1}}})
=> db.movies.updateOne({title:"Inception"}, {$addToSet:{languages:"Chinese"}})
=> db.movies.updateMany({director:"Christopher Nolan"},{$addToSet:{cast:"Michael Caine"}})
=> db.movies.updateMany({runtime:{$gt:140}},{$addToSet:{streamingOn:"Disney+"}})
=> db.movies.find({$and:[{genre:{$size:2}},{boxOffice:{$exists:true}},{specialFeatures:{$exists:false}}]})
=> db.movies.deleteMany({ rating: { $lt: 8.0}})
=> db.movies.updateMany({ year: { $lt: 2000 }, streamingOn: "Netflix" }, { $pull: { streamingOn:"Netflix"}})
=> db.movies.find({$expr:{ $gt: ["$boxOffice", { $multiply: ["$runtime",10]}]}})
=> db.movies.find({ genre: { $all: ["Action", "Sci-Fi"]}})
=> db.movies.find({cast:{$size:3}});