yii\mongodb\file\Collection::ensureChunkIndexes PHP Method

ensureChunkIndexes() private method

Ensures indexes at chunk collection.
private ensureChunkIndexes ( )
    private function ensureChunkIndexes()
    {
        $chunkCollection = $this->getChunkCollection();
        $indexKey = ['files_id' => 1, 'n' => 1];
        foreach ($chunkCollection->listIndexes() as $index) {
            if (!empty($index['unique']) && $index['key'] === $indexKey) {
                return;
            }
        }
        $chunkCollection->createIndex($indexKey, ['unique' => true]);
    }