title: mongo $slice query reverse index out of range
body: <p>The following query in mongo, behaves strange :</p>
  
  <pre><code>db.items.findOne({},{ "List": { "$slice": [ skip, 3 ] }})
  </code></pre>
  
  <p>First:
  Instead of returning one object with ["_id","List"] keys only, it returns a full object.</p>
  
  <p>Second:
  if <code>skip</code> is negative and <code>|skip|</code> is higher than list.length then it returns the first three elements as though <code>skip==0</code></p>
  
  <p>I would expect for:</p>
  
  <pre><code>{
         "_id" : ObjectId("542babf265f5de9a0d5c2928"),
         "List" : [
                  1,
                  2,
                  3,
                  4,
                  5
          ]
          "other" : "not_important"
  }
  </code></pre>
  
  <p>query:</p>
  
  <pre><code>db.items.findOne({},{ "List": { "$slice": [-10, 3 ] }})
  </code></pre>
  
  <p>to get:</p>
  
  <pre><code>{
         "_id" : ObjectId("542babf265f5de9a0d5c2928"),
         "List" : []
  }
  </code></pre>
  
  <p>instead, I get:</p>
  
  <pre><code>{
         "_id" : ObjectId("542babf265f5de9a0d5c2928"),
         "List" : [
                  1,
                  2,
                  3
          ]
          "other" : "not_important"
  }
  </code></pre>
  
  <p>Why?</p>
  
  <p>I use mongoDB 2.4.10</p>