public function getIndexInfo()
    {
        $convertIndex = function (\MongoDB\Model\IndexInfo $indexInfo) {
            $infos = [
                'v' => $indexInfo->getVersion(),
                'key' => $indexInfo->getKey(),
                'name' => $indexInfo->getName(),
                'ns' => $indexInfo->getNamespace(),
            ];

            $additionalKeys = [
                'unique',
                'sparse',
                'partialFilterExpression',
                'expireAfterSeconds',
                'storageEngine',
                'weights',
                'default_language',
                'language_override',
                'textIndexVersion',
                'collation',
                '2dsphereIndexVersion',
                'bucketSize'
            ];

            foreach ($additionalKeys as $key) {
                if (! isset($indexInfo[$key])) {
                    continue;
                }

                $infos[$key] = $indexInfo[$key];
            }

            return $infos;
        };

        return array_map($convertIndex, iterator_to_array($this->collection->listIndexes()));
    }
public function getIndexInfo()
    {
        $convertIndex = function (\MongoDB\Model\IndexInfo $indexInfo) {
            $infos = [
                'v' => $indexInfo->getVersion(),
                'key' => $indexInfo->getKey(),
                'name' => $indexInfo->getName(),
                'ns' => $indexInfo->getNamespace(),
            ];

            $additionalKeys = [
                'unique',
                'sparse',
                'partialFilterExpression',
                'expireAfterSeconds',
                'storageEngine',
                'weights',
                'default_language',
                'language_override',
                'textIndexVersion',
                'collation',
                '2dsphereIndexVersion',
                'bucketSize'
            ];

            foreach ($additionalKeys as $key) {
                if (! isset($indexInfo[$key])) {
                    continue;
                }

                $infos[$key] = $indexInfo[$key];
            }

            return $infos;
        };

        return array_map($convertIndex, iterator_to_array($this->collection->listIndexes()));
    }
public function getIndexInfo ( ) { $ convertIndex = function ( \ MongoDB \ Model \ IndexInfo $ indexInfo ) { $ infos = [ 'v' => $ indexInfo -> getVersion ( ) , 'key' => $ indexInfo -> getKey ( ) , 'name' => $ indexInfo -> getName ( ) , 'ns' => $ indexInfo -> getNamespace ( ) , ] ; $ additionalKeys = [ 'unique' , 'sparse' , 'partialFilterExpression' , 'expireAfterSeconds' , 'storageEngine' , 'weights' , 'default_language' , 'language_override' , 'textIndexVersion' , 'collation' , '2dsphereIndexVersion' , 'bucketSize' ] ; foreach ( $ additionalKeys as $ key ) { if ( ! isset ( $ indexInfo [ $ key ] ) ) { continue ; } $ infos [ $ key ] = $ indexInfo [ $ key ] ; } return $ infos ; } ; return array_map ( $ convertIndex , iterator_to_array ( $ this -> collection -> listIndexes ( ) ) ) ; }
Returns an array of index names for this collection

@link http://www.php.net/manual/en/mongocollection.getindexinfo.php
@return array Returns a list of index names.
Returns an array of index names for this collection