title: Mongo using indexes with sort
body: <p>I'm trying to optimize a mongodb query.  I have an index on <code>from_account_id</code>, <code>to_account_id</code>, and <code>created_at</code>.  But the following query does a full collection scan.</p>
  
  <pre><code>{
      "ts": {
          "$date": "2012-03-18T20:29:27.038Z"
      },
      "op": "query",
      "ns": "heroku_app2281692.transactions",
      "query": {
          "$query": {
              "$or": [
                  {
                      "from_account_id": {
                          "$oid": "4f55968921fcaf0001000005"
                      }
                  },
                  {
                      "to_account_id": {
                          "$oid": "4f55968921fcaf0001000005"
                      }
                  }
              ]
          },
          "$orderby": {
              "created_at": -1
          }
      },
      "ntoreturn": 25,
      "nscanned": 2643718,
      "responseLength": 20,
      "millis": 10499,
      "client": "10.64.141.77",
      "user": "heroku_app2281692"
  }
  </code></pre>
  
  <p>If I don't do the <code>or</code>, and only query <code>from_account_id</code> or <code>to_account_id</code> with an order on it, it's fast.</p>
  
  <p>What's the best way to get the desired effect?  Should I be keeping account_ids (both from and to) in one field like an array?  Or perhaps there is a better way.  Thanks!</p>