public function explain()
    {
        $optionNames = [
            'allowPartialResults',
            'batchSize',
            'cursorType',
            'limit',
            'maxTimeMS',
            'noCursorTimeout',
            'projection',
            'skip',
            'sort',
        ];

        $options = $this->getOptions($optionNames);

        $command = [
            'explain' => [
                'find' => $this->collection->getCollectionName(),
                'filter' => TypeConverter::fromLegacy($this->query),
            ] + $options,
        ];

        $explained = TypeConverter::toLegacy(iterator_to_array($this->db->command($command))[0]);
        unset($explained['ok']);

        return $explained;
    }
public function explain()
    {
        $optionNames = [
            'allowPartialResults',
            'batchSize',
            'cursorType',
            'limit',
            'maxTimeMS',
            'noCursorTimeout',
            'projection',
            'skip',
            'sort',
        ];

        $options = $this->getOptions($optionNames);

        $command = [
            'explain' => [
                'find' => $this->collection->getCollectionName(),
                'filter' => TypeConverter::fromLegacy($this->query),
            ] + $options,
        ];

        $explained = TypeConverter::toLegacy(iterator_to_array($this->db->command($command))[0]);
        unset($explained['ok']);

        return $explained;
    }
public function explain ( ) { $ optionNames = [ 'allowPartialResults' , 'batchSize' , 'cursorType' , 'limit' , 'maxTimeMS' , 'noCursorTimeout' , 'projection' , 'skip' , 'sort' , ] ; $ options = $ this -> getOptions ( $ optionNames ) ; $ command = [ 'explain' => [ 'find' => $ this -> collection -> getCollectionName ( ) , 'filter' => TypeConverter :: fromLegacy ( $ this -> query ) , ] + $ options , ] ; $ explained = TypeConverter :: toLegacy ( iterator_to_array ( $ this -> db -> command ( $ command ) ) [ 0 ] ) ; unset ( $ explained [ 'ok' ] ) ; return $ explained ; }
Return an explanation of the query, often useful for optimization and debugging
@link http://www.php.net/manual/en/mongocursor.explain.php
@return array Returns an explanation of the query.
Return an explanation of the query often useful for optimization and debugging