_:n937830105d0b4c908ac98126cfc608abxb0
<http://schema.org/text>
"db.aggregate( [\n   {\n      $documents: [\n         { playerId: \"PlayerA\", gameId: \"G1\", score: 1 },\n         { playerId: \"PlayerB\", gameId: \"G1\", score: 2 },\n         { playerId: \"PlayerC\", gameId: \"G1\", score: 3 },\n         { playerId: \"PlayerD\", gameId: \"G1\" },\n         { playerId: \"PlayerE\", gameId: \"G1\", score: null }\n      ]\n   },\n   {\n      $group:\n      {\n         _id: \"$gameId\",\n         minimumThreeScores:\n            {\n               $minN:\n                  {\n                     input: \"$score\",\n                     n: 4\n                  }\n            }\n      }\n   }\n] )"
<https://www.mongodb.com/docs/v7.0/reference/operator/aggregation/minN/>