Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In MongoDB, how to write the query sentences if I wanna get all the Mname that meet the following requirement: Movies that appear in My_List
In MongoDB, how to write the query sentences if I wanna get all the "Mname" that meet the following requirement:
Movies that appear in "My_List" of the user whose "UID" is "20120", but neither in "My_List" nor "Watching_History" of the user whose "UID" is "40120"
The above picture is User_video Collection. "Watching_History" is in another collection called "watching_history".
" id": ObjectId( "5c73937b89c02f323d00204e" "AID" 10100, "Atel": "123456", "Aemail""a01@net.com", "Aparticipation": "1", "User" "User1": 1 "UID" 10110, Uname" "f1 f" "Matched_ movies": 0 "My_list" [ "MID": 206 "Mname" "Black Mirror Bandersnatch" "Movie_image" "206.jpg", "Maturity": "16+" 7, 1, 3, "User2": 1 "UID" 10120, "Uname" "f1 m" "Matched movies": 1 "My_list [ "MID" 602, "Mname": "Friends", "Movie_image": "602.jpg", "Maturity": "13+" 7, "_id": ObjectId("5c6d2f1b7f60300c786e9d2c"), "UID": a02um "Watching_History"[ "Time_Date" ISODate("2019-02-16T05:59:00.449Z"), "MID": "f02" "Mname":"Friends" "Time_Date": ISODate("2019-02-10T05:57:44.812Z"), "MID": "b07" "Mname": "Black Swan" "Time_Date" ISODate("2019-02-09T05:54:20.338Z"), "MID""g04", "Mname": "Gossip Girl" "Time_Date": IS0Date( "2019-01-26T05:47:21.905Z") "MID": "b05" "Mname": "Black Mirror" "Time_Date" ISODate("2019-01-20T05:46:20.996Z"), "MID""s01", "Mname": "Sex Education
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started