Answers for "find only one max record in mongodb"

0

find only one max record in mongodb

db.temp.aggregate([
  {$group: {
      _id: "$total_wins",
      my_winner: {$push: "$$ROOT"}
  }},
  {$sort:{_id:-1}},
  {$limit:1}  ]).pretty()
Posted by: Guest on July-24-2021

Code answers related to "find only one max record in mongodb"

Browse Popular Code Answers by Language