public function slice($field, $limit, $skip = null)
    {
        $limit  = (int) $limit;
        $skip   = (int) $skip;

        if ($skip) {
            $this->projection[$field] = array('$slice' => array($skip, $limit));
        } else {
            $this->projection[$field] = array('$slice' => $limit);
        }

        $this->skipDocumentPool();

        return $this;
    }
public function slice($field, $limit, $skip = null)
    {
        $limit  = (int) $limit;
        $skip   = (int) $skip;

        if ($skip) {
            $this->projection[$field] = array('$slice' => array($skip, $limit));
        } else {
            $this->projection[$field] = array('$slice' => $limit);
        }

        $this->skipDocumentPool();

        return $this;
    }
public function slice ( $ field , $ limit , $ skip = null ) { $ limit = ( int ) $ limit ; $ skip = ( int ) $ skip ; if ( $ skip ) { $ this -> projection [ $ field ] = array ( '$slice' => array ( $ skip , $ limit ) ) ; } else { $ this -> projection [ $ field ] = array ( '$slice' => $ limit ) ; } $ this -> skipDocumentPool ( ) ; return $ this ; }
Paginate list of sub-documents

@param string $field
@param integer $limit
@param integer $skip
@return \Sokil\Mongo\Cursor
@throws Exception
Paginate list of sub - documents