src/Webiny/Hrc/CacheStorage/Mongo.php
public function installCollections()
    {
        $collections = $this->mongoInstance->listCollections();

        foreach ($collections as $collection) {
            /* @var $collection CollectionInfo */
            if ($collection->getName() == self::collection) {
                return true;
            }
        }

        $this->mongoInstance->createCollection(self::collection);
        $this->mongoInstance->createIndex(self::collection, new SingleIndex('key', 'key', false, true));
        $this->mongoInstance->createIndex(self::collection, new SingleIndex('ttl', 'ttl', false, false, false, 0));

        return true;

    }
public function installCollections()
    {
        $collections = $this->mongoInstance->listCollections();

        foreach ($collections as $collection) {
            /* @var $collection CollectionInfo */
            if ($collection->getName() == self::collection) {
                return true;
            }
        }

        $this->mongoInstance->createCollection(self::collection);
        $this->mongoInstance->createIndex(self::collection, new SingleIndex('key', 'key', false, true));
        $this->mongoInstance->createIndex(self::collection, new SingleIndex('ttl', 'ttl', false, false, false, 0));

        return true;

    }
public function installCollections ( ) { $ collections = $ this -> mongoInstance -> listCollections ( ) ; foreach ( $ collections as $ collection ) { /* @var $collection CollectionInfo */ if ( $ collection -> getName ( ) == self :: collection ) { return true ; } } $ this -> mongoInstance -> createCollection ( self :: collection ) ; $ this -> mongoInstance -> createIndex ( self :: collection , new SingleIndex ( 'key' , 'key' , false , true ) ) ; $ this -> mongoInstance -> createIndex ( self :: collection , new SingleIndex ( 'ttl' , 'ttl' , false , false , false , 0 ) ) ; return true ; }
Installs the required mongo collection for cache storage and creates the required indexes.

@return bool
Installs the required mongo collection for cache storage and creates the required indexes .