1.
- db.movies.find({runtime:{$gt:150}}).count()
- movieflix> db.movies.find({rating:{$gt:8.5}}).count()
- movieflix> db.movies.find({year:{$gt:2000,$lt:2015}}).count()
- movieflix> db.movies.find({boxOffice:{$gt:500.0,$lt:1000.0}}).count()
2.
db.movies.find({$and:[{director:"Christopher Nolan"},{isOscarWinner:true},{boxOffice:{$gt:700}},{streamingOn:"Netflix"}]},{title:true,_id:false})
3.
db.movies.find({"specialFeatures.behindTheScenes":true, "specialFeatures.deletedScenes":true},{_id:false})
4.
db.movies.find({$and: [{ cast: { $in: ["Carrie-Anne Moss", "Morgan Freeman"] } },{ languages: { $exists: true, $ne: [] } },{ streamingOn: { $size: { $gte: 2 } } }]});
5.
db.movies.updateOne({ title: "Inception" },$addToSet: { languages: "Chinese" } );
6.
db.movies.updateMany({ director: "Christopher Nolan" },{ $addToSet: { cast: "Michael Caine" } });
7.
db.movies.updateMany({ runtime: { $gt: 140 } },{ $addToSet: { streamingOn: "Disney+" } });
8.
db.movies.find({$and: [{ genre: { $size: 2 } },{ boxOffice: { $exists: true } },{ specialFeatures: { $exists: false } }]});
9.
db.movies.deleteMany({ rating: { $lt: 8.0 } });
10.
db.movies.updateMany({ year: { $lt: 2000 } },{ $pull: { streamingOn: "Netflix" } });
11.
db.movies.find({$expr: { $gt: ["$boxOffice", { $multiply: ["$runtime", 10] }] }});
12.
const matrixStreamingPlatforms = db.movies.findOne({ title: "The Matrix" }).streamingOn;
db.movies.find({ streamingOn: { $all: matrixStreamingPlatforms, $size: matrixStreamingPlatforms.length } });
13.
db.movies.find({genre: { $all: ["Action", "Sci-Fi"] }});
14.
db.movies.find({"genre.0": "Action"});
15.
db.movies.find({cast: { $size: 3 }});