title: Mongoose aggregation $match distinct based on another field?
body: <p>I have a collection like this:</p>
  
  <pre><code>[
    {
      "ticketNumber" : "00001",
      "version" : "0"
    },
    {
      "ticketNumber" : "00001",
      "version" : "1"
    },
    {
      "ticketNumber" : "00001",
      "version" : "2"
    },
    {
      "ticketNumber" : "00002",
      "version" : "0"
    },
    {
      "ticketNumber" : "00003",
      "version" : "0"
    },
    {
      "ticketNumber" : "00003",
      "version" : "1"
    }
  ]
  </code></pre>
  
  <p>The model has additional attributes that I'll be using in a later aggregation pipe. I first need to filter in a way so it returns the tickets based on the distinct ticketNumber and the newest version:</p>
  
  <pre><code>[
    {
      "ticketNumber" : "00001",
      "version" : "2"
    },
    {
      "ticketNumber" : "00002",
      "version" : "0"
    },
    {
      "ticketNumber" : "00003",
      "version" : "1"
    }
  ]
  </code></pre>
  
  <p>Not sure if this is do-able somehow?</p>