Phalcon\Db\Adapter\MongoDB\GridFS\CollectionWrapper::ensureChunksIndex PHP Method

ensureChunksIndex() private method

Create an index on the chunks collection if it does not already exist.
private ensureChunksIndex ( )
    private function ensureChunksIndex()
    {
        foreach ($this->chunksCollection->listIndexes() as $index) {
            if ($index->isUnique() && $index->getKey() === ['files_id' => 1, 'n' => 1]) {
                return;
            }
        }
        $this->chunksCollection->createIndex(['files_id' => 1, 'n' => 1], ['unique' => true]);
    }