public function getCollectionInfo(array $options = [])
    {
        $includeSystemCollections = false;
        // The includeSystemCollections option is no longer supported in the command
        if (isset($options['includeSystemCollections'])) {
            $includeSystemCollections = $options['includeSystemCollections'];
            unset($options['includeSystemCollections']);
        }

        try {
            $collections = $this->db->listCollections($options);
        } catch (\MongoDB\Driver\Exception\Exception $e) {
            throw ExceptionConverter::toLegacy($e);
        }

        $getCollectionInfo = function (CollectionInfo $collectionInfo) {
            // @todo do away with __debugInfo once https://jira.mongodb.org/browse/PHPLIB-226 is fixed
            $info = $collectionInfo->__debugInfo();

            return array_filter(
                [
                    'name' => $collectionInfo->getName(),
                    'type' => isset($info['type']) ? $info['type'] : null,
                    'options' => $collectionInfo->getOptions(),
                    'info' => isset($info['info']) ? (array) $info['info'] : null,
                    'idIndex' => isset($info['idIndex']) ? (array) $info['idIndex'] : null,
                ],
                function ($item) {
                    return $item !== null;
                }
            );
        };

        $eligibleCollections = array_filter(
            iterator_to_array($collections),
            $this->getSystemCollectionFilterClosure($includeSystemCollections)
        );

        return array_map($getCollectionInfo, $eligibleCollections);
    }
public function getCollectionInfo(array $options = [])
    {
        $includeSystemCollections = false;
        // The includeSystemCollections option is no longer supported in the command
        if (isset($options['includeSystemCollections'])) {
            $includeSystemCollections = $options['includeSystemCollections'];
            unset($options['includeSystemCollections']);
        }

        try {
            $collections = $this->db->listCollections($options);
        } catch (\MongoDB\Driver\Exception\Exception $e) {
            throw ExceptionConverter::toLegacy($e);
        }

        $getCollectionInfo = function (CollectionInfo $collectionInfo) {
            // @todo do away with __debugInfo once https://jira.mongodb.org/browse/PHPLIB-226 is fixed
            $info = $collectionInfo->__debugInfo();

            return array_filter(
                [
                    'name' => $collectionInfo->getName(),
                    'type' => isset($info['type']) ? $info['type'] : null,
                    'options' => $collectionInfo->getOptions(),
                    'info' => isset($info['info']) ? (array) $info['info'] : null,
                    'idIndex' => isset($info['idIndex']) ? (array) $info['idIndex'] : null,
                ],
                function ($item) {
                    return $item !== null;
                }
            );
        };

        $eligibleCollections = array_filter(
            iterator_to_array($collections),
            $this->getSystemCollectionFilterClosure($includeSystemCollections)
        );

        return array_map($getCollectionInfo, $eligibleCollections);
    }
public function getCollectionInfo ( array $ options = [ ] ) { $ includeSystemCollections = false ; // The includeSystemCollections option is no longer supported in the command if ( isset ( $ options [ 'includeSystemCollections' ] ) ) { $ includeSystemCollections = $ options [ 'includeSystemCollections' ] ; unset ( $ options [ 'includeSystemCollections' ] ) ; } try { $ collections = $ this -> db -> listCollections ( $ options ) ; } catch ( \ MongoDB \ Driver \ Exception \ Exception $ e ) { throw ExceptionConverter :: toLegacy ( $ e ) ; } $ getCollectionInfo = function ( CollectionInfo $ collectionInfo ) { // @todo do away with __debugInfo once https://jira.mongodb.org/browse/PHPLIB-226 is fixed $ info = $ collectionInfo -> __debugInfo ( ) ; return array_filter ( [ 'name' => $ collectionInfo -> getName ( ) , 'type' => isset ( $ info [ 'type' ] ) ? $ info [ 'type' ] : null , 'options' => $ collectionInfo -> getOptions ( ) , 'info' => isset ( $ info [ 'info' ] ) ? ( array ) $ info [ 'info' ] : null , 'idIndex' => isset ( $ info [ 'idIndex' ] ) ? ( array ) $ info [ 'idIndex' ] : null , ] , function ( $ item ) { return $ item !== null ; } ) ; } ; $ eligibleCollections = array_filter ( iterator_to_array ( $ collections ) , $ this -> getSystemCollectionFilterClosure ( $ includeSystemCollections ) ) ; return array_map ( $ getCollectionInfo , $ eligibleCollections ) ; }
Returns information about collections in this database

@link http://www.php.net/manual/en/mongodb.getcollectioninfo.php
@param array $options An array of options for listing the collections.
@return array
Returns information about collections in this database