You are here

public function MongoCollectionFactory::command in MongoDB 8

Runs a command on the same server where a collection is.

Parameters

string $collection_name:

array $command:

Return value

array

File

src/MongoCollectionFactory.php, line 127
Definition of Drupal\mongodb\MongodbBundle.

Class

MongoCollectionFactory
Creates mongo collections based on settings.

Namespace

Drupal\mongodb

Code

public function command($collection_name, array $command) {
  return $this
    ->getClient($this
    ->getServer($collection_name))->admin
    ->command($command);
}