RenameCollection
in package
FinalYes
Operation for the renameCollection command.
Tags
Table of Contents
Properties
- $fromNamespace : string
- $options : array<string|int, mixed>
- $toNamespace : string
Methods
- __construct() : mixed
- Constructs a renameCollection command.
- execute() : void
- Execute the operation.
- createCommand() : Command
- Create the renameCollection command.
- createOptions() : array<string|int, mixed>
- Create options for executing the command.
Properties
$fromNamespace
private
string
$fromNamespace
$options
private
array<string|int, mixed>
$options
= []
$toNamespace
private
string
$toNamespace
Methods
__construct()
Constructs a renameCollection command.
public
__construct(string $fromDatabaseName, string $fromCollectionName, string $toDatabaseName, string $toCollectionName[, array<string|int, mixed> $options = [] ]) : mixed
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.
-
writeConcern (MongoDB\Driver\WriteConcern): Write concern.
-
dropTarget (boolean): If true, MongoDB will drop the target before renaming the collection.
Parameters
- $fromDatabaseName : string
-
Database name
- $fromCollectionName : string
-
Collection name
- $toDatabaseName : string
-
New database name
- $toCollectionName : string
-
New collection name
- $options : array<string|int, mixed> = []
-
Command options
Tags
execute()
Execute the operation.
public
execute(Server $server) : void
Parameters
- $server : Server
Tags
createCommand()
Create the renameCollection command.
private
createCommand() : Command
Return values
CommandcreateOptions()
Create options for executing the command.
private
createOptions() : array<string|int, mixed>