db.movies.insertMany([{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: 'Inglourious 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: 2014,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 s Big Adventure',year: 1985},{title: 'Avatar',year: 2009}])
Shearch by field
db.movies.find({writer:'Quentin Tarantino'})
db.movies.find({actors:'Brad Pitt'})
db.movies.find({franchise:'The Hobbit'})
Search between dates
db.movies.find({year:{$gte:1900, $lte:1999}})
db.movies.find({year:{$gte:2000, $lte:2010}})
Update a document by _id
db.movies.updateOne({_id: ObjectId("64b7f90c4a448846c65d6fd3")},{$set:{synopsis: 'A reluctant hobbit, Bilbo Baggins, sets out to the Lonely Mountain with spirited group of dwarves to reclaim their montain home-and the gold within it- from the dragon Smaug.'}})
db.movies.updateOne({_id: ObjectId("64b7f90c4a448846c65d6fd4")},{$set:{synopsis: '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.'}})