original_string: 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]);
      }
code: 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]);
      }
code_tokens: 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 ] ) ; }
docstring: Create an index on the chunks collection if it does not already exist.
docstring_tokens: Create an index on the chunks collection if it does not already exist .