title: How to take inner array with limit in mongo db using php?
body: <p>Take inner array of mongo document using with <code>limit</code> and <code>skip</code> in php.</p>
  
  <pre><code>$db-&gt;users-&gt;findOne(array('_id' =&gt; new MongoId('5045fa0213cfcdfc06000008')));
  </code></pre>
  
  <p>Above query will give me below mongo array</p>
  
  <pre><code>[_id] =&gt; MongoId Object (
      [$id] =&gt; 5045fa0213cfcdfc06000008
  )
  [items] =&gt; Array (
      [0] =&gt; 13
      [1] =&gt; 4
      [2] =&gt; 3
      [3] =&gt; 7
      [4] =&gt; 10
      [5] =&gt; 11
      [6] =&gt; 28
      [7] =&gt; 54
      [8] =&gt; 31
      [9] =&gt; 33
      [10] =&gt; 37
      [11] =&gt; 12
  )
  </code></pre>
  
  <p>Is it possible to make use of <code>limit</code> with <code>skip</code> with above mongo doc, something like below  </p>
  
  <pre><code>$db-&gt;users-&gt;
    findOne(array('_id' =&gt; new MongoId('5045fa0213cfcdfc06000008')))-&gt;
      limit(5)-&gt;skip(5);
  </code></pre>
  
  <p>Which will output as </p>
  
  <pre><code>[_id] =&gt; MongoId Object (
      [$id] =&gt; 5045fa0213cfcdfc06000008
  )
  [items] =&gt; Array (
      [5] =&gt; 11
      [6] =&gt; 28
      [7] =&gt; 54
      [8] =&gt; 31
      [9] =&gt; 33
  )
  </code></pre>
  
  <p>And how to take total count of <code>items</code> array using mongo?</p>