Documentation

ModifyCollection
in package

FinalYes

Operation for the collMod command.

Tags
see
Database::modifyCollection()
see
https://mongodb.com/docs/manual/reference/command/collMod/

Table of Contents

Properties

$collectionName  : string
$collectionOptions  : array<string|int, mixed>
$databaseName  : string
$options  : array<string|int, mixed>

Methods

__construct()  : mixed
Constructs a collMod command.
execute()  : array<string|int, mixed>|object
Execute the operation.
createCommand()  : Command
createOptions()  : array<string|int, mixed>
Create options for executing the command.

Properties

Methods

__construct()

Constructs a collMod command.

public __construct(string $databaseName, string $collectionName, array<string|int, mixed> $collectionOptions[, 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.

  • 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
$databaseName : string

Database name

$collectionName : string

Collection or view to modify

$collectionOptions : array<string|int, mixed>

Collection or view options to assign

$options : array<string|int, mixed> = []

Command options

Tags
throws
InvalidArgumentException

for parameter/option parsing errors

execute()

Execute the operation.

public execute(Server $server) : array<string|int, mixed>|object
Parameters
$server : Server
Tags
throws
RuntimeException

for other driver errors (e.g. connection errors)

Return values
array<string|int, mixed>|object

Command result document

createCommand()

private createCommand() : Command
Return values
Command

        
On this page

Search results