/* Exc 1 use ("Practice") /* Insert documents */ /* db.students.insertMany([ { "name":"Johnson", "student_id":70012345, "address":{ "street":"10 Downing Street", "city":"Kansas City", "State":"KS" }, "contacts":{ "phone_number":[ 816123456, 800123456 ], "Emails":[ "johnson@gmail.com, johnson@yahoo.com" ] } }, { "name":"Kate", "student_id":700777888, "address":{ "street":"888 Washington Street", "city":"Kansas City", "State":"MO" }, "contacts":{ "Emails":[ "kate@hotmail.com", "kate@gmail.com" ] } } ]) db.students.updateOne( {name : 'Kate', 'contacts.Emails' : 'kate@hotmail.com'}, {$set : {'contacts.Emails.$': 'kate@yahoo.com'}} ) db.students. nd(); */ fi // Exc 2 /* use('Books'); db.data. nd({ $or : [ {categories : {$regex : 'Software'}}, {categories : {$regex : 'Programming'}}, ] }) */ //Exc 3 /* use('sample_m ix'); fi fl fi fi const movie_id = db.comments.distinct("movie_id", {name : 'Robert Baratheon'}) db.results.drop(); movie_id.forEach(function(id){ const movie = db.movies. ndOne({_id: id}); db.results.insertOne(movie); }) db.results. nd({}, {_id:0, title:1}).limit(3) */