Skip to content

Latest commit

 

History

History
180 lines (72 loc) · 1.94 KB

ModifyCollection.md

File metadata and controls

180 lines (72 loc) · 1.94 KB

ModifyCollection

Operation for the collMod command.

See Also:

Properties

databaseName

private string $databaseName

collectionName

private string $collectionName

collectionOptions

private array $collectionOptions

options

private array $options

Methods

__construct

Constructs a collMod command.

public __construct(string $databaseName, string $collectionName, array $collectionOptions, array $options = []): mixed

Supported options:

  • session (MongoDB\Driver\Session): Client session.

  • typeMap (array): Type map for BSON deserialization. This will only be used for the returned command result document.

  • writeConcern (MongoDB\Driver\WriteConcern): Write concern.

Parameters:

Parameter Type Description
$databaseName string Database name
$collectionName string Collection or view to modify
$collectionOptions array Collection or view options to assign
$options array Command options

execute

Execute the operation.

public execute(\MongoDB\Driver\Server $server): array|object

Parameters:

Parameter Type Description
$server \MongoDB\Driver\Server

Return Value:

Command result document

See Also:

  • \MongoDB\Operation\Executable::execute() -

createOptions

Create options for executing the command.

private createOptions(): array

See Also: