MongoDB\Driver\Server::executeCommand — Execute a database command on this server
command on this server.
readPreferenceparameter does not control the server to which the driver issues the command; the command will always be executed on this server object. Instead, it may be used when issuing the command to a secondary (from a replica set connection, not standalone) or mongos node to ensure that the driver sets the wire protocol accordingly or adds the read preference to the command document, respectively.
The name of the database on which to execute the command.
The MongoDB\Driver\Command to execute.
Returns MongoDB\Driver\Cursor on success.
It is the caller's responsibility to ensure that the server is capable of executing the command. For example, executing a write operation on a secondary (excluding its "local" database) will fail.