Documentation

DropDatabase
in package

FinalYes

Operation for the dropDatabase command.

Tags
see
Client::dropDatabase()
see
Database::drop()
see
https://mongodb.com/docs/manual/reference/command/dropDatabase/

Table of Contents

Properties

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

Methods

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

Properties

Methods

__construct()

Constructs a dropDatabase command.

public __construct(string $databaseName[, 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.

Parameters
$databaseName : string

Database name

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

Command options

Tags
throws
InvalidArgumentException

for parameter/option parsing errors

execute()

Execute the operation.

public execute(Server $server) : void
Parameters
$server : Server
Tags
throws
RuntimeException

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

createCommand()

Create the dropDatabase command.

private createCommand() : Command
Return values
Command

        
On this page

Search results