private function executeLegacy(Server $server)
{
$filter = empty($this->options['filter']) ? [] : (array) $this->options['filter'];
if (array_key_exists('name', $filter)) {
if (!is_string($filter['name'])) {
throw InvalidArgumentException::invalidType('filter name for MongoDB <3.0', $filter['name'], 'string');
}
$filter['name'] = $this->databaseName . '.' . $filter['name'];
}
$options = isset($this->options['maxTimeMS']) ? ['modifiers' => ['$maxTimeMS' => $this->options['maxTimeMS']]] : [];
$cursor = $server->executeQuery($this->databaseName . '.system.namespaces', new Query($filter, $options));
$cursor->setTypeMap(['root' => 'array', 'document' => 'array']);
return new CollectionInfoLegacyIterator($cursor);
}