title: mongodb query to verify embedded array sequence numbers
body: <p>given a document structure as shown, where the trades array can have thousands of items... how on earth could one do a query that would verify that the sequence always has 'startTradeId' one number higher than the previous items 'endTradeId', all the way through the array? is this even possible?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    {
        "name": "STOCK",
        "trades": [{
            "endTradeId": 41306,
            "startTradeId": 41302,
            ...
          },
          {
            "endTradeId": 41301,
            "startTradeId": 41297,
            ...
          },
          {
            "endTradeId": 41296,
            "startTradeId": 41240,
            ...
          },
          ...
        ]
      }</code></pre>
  </div>
  </div>
  </p>