title: How to use $match in MongoDB
body: <p>So currently I am struggling to get the right results from my query.
  Here is how it looks:</p>
  
  <pre><code>db.pitching.aggregate([
      { $match: {} },
      { $group: {
          _id: "$playerid",
          maxIpouts: { $max: "$ipouts" }
      }}
  ])
  </code></pre>
  
  <p>I know that I have to use <strong><code>$match</code></strong> to get the right results. I want to get a single player has the highest (<strong><code>$max</code></strong>) ipouts, but im not sure how to filter that using <strong><code>$match</code></strong>. </p>
  
  <p>Without <strong><code>$match</code></strong> it gives me the <strong><code>player_id</code></strong> and each ipout for the player rather than a single player id having the highest <code>ipout</code>.</p>