Moodle PHP Documentation 4.1
Moodle 4.1.11 (Build: 20240610) (c8c84b4af18)
MongoDB\Operation\RenameCollection Class Reference
Inheritance diagram for MongoDB\Operation\RenameCollection:
MongoDB\Operation\Executable

Public Member Functions

 __construct (string $fromDatabaseName, string $fromCollectionName, string $toDatabaseName, string $toCollectionName, array $options=[])
 Constructs a renameCollection command.
 
 execute (Server $server)
 Execute the operation.
 

Constructor & Destructor Documentation

◆ __construct()

MongoDB\Operation\RenameCollection::__construct ( string $fromDatabaseName,
string $fromCollectionName,
string $toDatabaseName,
string $toCollectionName,
array $options = [] )

Constructs a renameCollection command.

Supported options:

  • comment (mixed): BSON value to attach as a comment to this command.

    This is not supported for servers versions < 4.4.

  • session (MongoDB\Driver\Session): Client session.
  • typeMap (array): Type map for BSON deserialization. This will be used for the returned command result document.
  • writeConcern (MongoDB\Driver\WriteConcern): Write concern.
  • dropTarget (boolean): If true, MongoDB will drop the target before renaming the collection.
Parameters
string$fromDatabaseNameDatabase name
string$fromCollectionNameCollection name
string$toDatabaseNameNew database name
string$toCollectionNameNew collection name
array$optionsCommand options
Exceptions
InvalidArgumentExceptionfor parameter/option parsing errors

Member Function Documentation

◆ execute()

MongoDB\Operation\RenameCollection::execute ( Server $server)

Execute the operation.

See also
Executable\execute()
Return values
array|objectCommand result document
Exceptions
UnsupportedExceptionif write concern is used and unsupported
DriverRuntimeExceptionfor other driver errors (e.g. connection errors)

Implements MongoDB\Operation\Executable.


The documentation for this class was generated from the following file: