Map Reduce
Map Reduce
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Users\HP> mongosh
------
2023-10-16T01:34:24.222+05:30: Access control is not enabled for the database. Read and write
access to data and configuration is unrestricted
------
switched to db Shubham
Shubham> db.stud.find({})
_id: ObjectId("65394c4179bc104fb33a3d59"),
rno: 16,
name: 'Shubham',
subject: 'DBMS',
marks: 45
},
{
_id: ObjectId("65394c4179bc104fb33a3d5a"),
rno: 16,
name: 'Shubham',
subject: 'CNS',
marks: 40
},
_id: ObjectId("65394c4179bc104fb33a3d5b"),
rno: 16,
name: 'Shubham',
subject: 'TOC',
marks: 30
},
_id: ObjectId("65394c9c79bc104fb33a3d5c"),
rno: 13,
name: 'Ram',
subject: 'CNS',
marks: 45
},
_id: ObjectId("65394c9c79bc104fb33a3d5d"),
rno: 16,
name: 'Ram',
subject: 'TOC',
marks: 40
},
_id: ObjectId("65394c9c79bc104fb33a3d5e"),
rno: 13,
name: 'Ram',
subject: 'DSA',
marks: 45
},
_id: ObjectId("65394cd979bc104fb33a3d5f"),
rno: 16,
name: 'Pratik',
subject: 'DBMS',
marks: 40
},
_id: ObjectId("65394cd979bc104fb33a3d60"),
rno: 11,
name: 'Pratik',
subject: 'CNS',
marks: 50
},
_id: ObjectId("65394cd979bc104fb33a3d61"),
rno: 11,
name: 'Pratik',
subject: 'TOC',
marks: 20
},
_id: ObjectId("65394d1979bc104fb33a3d62"),
rno: 1,
name: 'Sid',
subject: 'DBMS',
marks: 30
},
{
_id: ObjectId("65394d1979bc104fb33a3d63"),
rno: 11,
name: 'Sid',
subject: 'CNS',
marks: 30
},
_id: ObjectId("65394d1979bc104fb33a3d64"),
rno: 1,
name: 'Sid',
subject: 'TOC',
marks: 50
Shubham> db.totalMarks.find({})
Shubham> db.avgMarks.find({}).sort({value:-1})
Shubham>
if(totalMarks <115 ){
else{
return "Fail";}