original_string: public function createIndexes(array $indexes, array $options = [])
      {
          $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
  
          if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) {
              $options['writeConcern'] = $this->writeConcern;
          }
  
          $operation = new CreateIndexes($this->databaseName, $this->collectionName, $indexes, $options);
  
          return $operation->execute($server);
      }
code: public function createIndexes(array $indexes, array $options = [])
      {
          $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
  
          if ( ! isset($options['writeConcern']) && \MongoDB\server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern)) {
              $options['writeConcern'] = $this->writeConcern;
          }
  
          $operation = new CreateIndexes($this->databaseName, $this->collectionName, $indexes, $options);
  
          return $operation->execute($server);
      }
code_tokens: public function createIndexes ( array $ indexes , array $ options = [ ] ) { $ server = $ this -> manager -> selectServer ( new ReadPreference ( ReadPreference :: RP_PRIMARY ) ) ; if ( ! isset ( $ options [ 'writeConcern' ] ) && \ MongoDB \ server_supports_feature ( $ server , self :: $ wireVersionForWritableCommandWriteConcern ) ) { $ options [ 'writeConcern' ] = $ this -> writeConcern ; } $ operation = new CreateIndexes ( $ this -> databaseName , $ this -> collectionName , $ indexes , $ options ) ; return $ operation -> execute ( $ server ) ; }
docstring: Create one or more indexes for the collection.
  
  Each element in the $indexes array must have a "key" document, which
  contains fields mapped to an order or type. Other options may follow.
  For example:
  
  $indexes = [
  // Create a unique index on the "username" field
  [ 'key' => [ 'username' => 1 ], 'unique' => true ],
  // Create a 2dsphere index on the "loc" field with a custom name
  [ 'key' => [ 'loc' => '2dsphere' ], 'name' => 'geo' ],
  ];
  
  If the "name" option is unspecified, a name will be generated from the
  "key" document.
  
  @see http://docs.mongodb.org/manual/reference/command/createIndexes/
  @see http://docs.mongodb.org/manual/reference/method/db.collection.createIndex/
  @see CreateIndexes::__construct() for supported command options
  @param array[] $indexes List of index specifications
  @param array   $options Command options
  @return string[] The names of the created indexes
  @throws UnsupportedException if options are not supported by the selected server
  @throws InvalidArgumentException for parameter/option parsing errors
  @throws DriverRuntimeException for other driver errors (e.g. connection errors)
docstring_tokens: Create one or more indexes for the collection .