Challenge

Project 2

db_movie> use movies
switched to db movies
movies> db.movies.insert({
... mov_id:121,
... mov_name:"KGF2",
... mov_genre:"HISTORICAL DRAMA",
... language:"ENGLISH/HINDI",
... cast:"DRAMA",
... producer:"VIJAY",
... director:"PRASANTH NEEL",
... mov_year:2022
... }
... )
DeprecationWarning: Collection.insert() is deprecated. Use insertOne, insertMany, or bulkWrite.
{
acknowledged: true,
insertedIds: { '0': ObjectId("637cee9de17e92ba7eeae701") }
}
movies> db.movies.find()
[
{
_id: ObjectId("637cee9de17e92ba7eeae701"),
mov_id: 121,
mov_name: 'KGF2',
mov_genre: 'HISTORICAL DRAMA',
language: 'ENGLISH/HINDI',
cast: 'DRAMA',
producer: 'VIJAY',
director: 'PRASANTH NEEL',
mov_year: 2022
}
]
 
 
 
2.
 
movies> db.movies.find({mov_year:"2022"})
 
 
 
3.
 
db.movies.find({"year": 2019})
 
 
 
4.
 
{ "cast": { "$JusticeLeague": { "movie_id": "tt0974015", "role": "Bruce Wayne / villan" } } }
 
 
 
5.
 
db.movies.find().sort({"name":1})
 
 
 
db.movies.find().sort({"name":-1})
 
 
 
6.
 
db.movieDetails.find({
 
director_name:"Shetty"},
 
{mov_Id: 101, Mov_year: 2020, producer_name: "vijay"
 
})
 
 
 
7.
 
db.movies.find(
 
{"year":{"$mov_year":2018}}).projection({"title":1}
 
)
 
 
 
8.
 
db.movieDetails.find(
 
{"genres":"Thriller"},{_id:1, title:1, director:1, producer:1}
 
)
 
 
 
9.
 
db.movies.find(
 
{mov_title,mov_year}, {title: "Thriller", year: 2018}
 
)
 
10.
 
db.movies.find(
 
{"producer":"John Smith"}
 
)
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.