Moodle PHP Documentation 4.1
Moodle 4.1.11 (Build: 20240610) (c8c84b4af18)
|
Public Member Functions | |
__construct (string $databaseName, string $collectionName, array $options=[]) | |
Constructs a create command. | |
execute (Server $server) | |
Execute the operation. | |
Public Attributes | |
const | NO_PADDING = 2 |
const | USE_POWER_OF_2_SIZES = 1 |
MongoDB\Operation\CreateCollection::__construct | ( | string | $databaseName, |
string | $collectionName, | ||
array | $options = [] ) |
Constructs a create command.
Supported options:
autoIndexId (boolean): Specify false to disable the automatic creation of an index on the _id field. For replica sets, this option cannot be false. The default is true.
This option has been deprecated since MongoDB 3.2. As of MongoDB 4.0, this option cannot be false when creating a replicated collection (i.e. a collection outside of the local database in any mongod mode).
comment (mixed): BSON value to attach as a comment to this command.
This is not supported for servers versions < 4.4.
changeStreamPreAndPostImages (document): Used to configure support for pre- and post-images in change streams.
This is not supported for server versions < 6.0.
clusteredIndex (document): A clustered index specification.
This is not supported for server versions < 5.3.
expireAfterSeconds: The TTL for documents in time series collections.
This is not supported for servers versions < 5.0.
timeseries (document): Options for time series collections.
This is not supported for servers versions < 5.0.
string | $databaseName | Database name |
string | $collectionName | Collection name |
array | $options | Command options |
InvalidArgumentException | for parameter/option parsing errors |
MongoDB\Operation\CreateCollection::execute | ( | Server | $server | ) |
Execute the operation.
array|object | Command result document |
DriverRuntimeException | for other driver errors (e.g. connection errors) |
Implements MongoDB\Operation\Executable.