top of page

Mongodb assignment notes

  • Writer: TCO
    TCO
  • Apr 3, 2022
  • 1 min read

Updated: Apr 4, 2022

Old question was like:


Write a query to display student ID and class ID for students whose score are greater than 99.00. Sort the result based on student ID from high to low and class ID from low to high.



db.grades.find({scores: { $elemMatch: { score: {$gt: 99} } } }, {_id: 0, student_id: 1, class_id: 1, scores: 1}).sort({student_id: -1, class_id: 1})

ree

db.students.aggregate({
$group: {
_id:
{"scores": "$scores", "type": "$type"}
}
})

ree

 
 
 

Recent Posts

See All
My Summer 2024 schedule

My classmate said the C# course wasn't as good as expected, and it was just "powerpoint reading". When I already dislike Abidin Akkok's...

 
 
 

Comments


Post: Blog2_Post
  • LinkedIn

©2021 by On learns to rock. Proudly created with Wix.com

bottom of page