public function __construct($databaseName, $collectionName, $indexName, array $options = [])
{
$indexName = (string) $indexName;
if ($indexName === '') {
throw new InvalidArgumentException('$indexName cannot be empty');
}
if (isset($options['typeMap']) && !is_array($options['typeMap'])) {
throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array');
}
$this->databaseName = (string) $databaseName;
$this->collectionName = (string) $collectionName;
$this->indexName = $indexName;
$this->options = $options;
}