public function listIndexes($collectionName, $options = [])
{
$this->document = $this->db->getQueryBuilder()->listIndexes($collectionName, $options);
try {
$cursor = $this->execute();
} catch (Exception $e) {
// The server may return an error if the collection does not exist.
$notFoundCodes = [26, 60];
if (in_array($e->getCode(), $notFoundCodes, true)) {
return [];
}
throw $e;
}
return $cursor->toArray();
}