Клас The MongoDB\Driver\Command
(mongodb >=1.0.0)
Вступ
КлассMongoDB\Driver\Command - Це об'єкт значення, що представляє команду бази даних.
Щоб надати Помічників команд (Command Helpers) має бути створено об'єкт MongoDB\Driver\Command
Огляд класів
final
class MongoDB\Driver\Command
{
/* Методы */
final public __construct(array|object $document, ?array $commandOptions = null)
}
Приклади
Приклад #1 ИспользованиеMongoDB\Driver\Commandдля предоставления помощника по созданию коллекций
Loading...
Результат виконання наведеного прикладу:
object(MongoDB\Driver\Command)#3 (1) {
["command"]=>
array(3) {
["create"]=>
string(16) "cappedCollection"
["capped"]=>
bool(true)
["size"]=>
int(65536)
}
}
array(1) {
["ok"]=>
float(1)
}
array(16) {
["ns"]=>
string(29) "databaseName.cappedCollection"
["count"]=>
int(0)
["size"]=>
int(0)
["numExtents"]=>
int(1)
["storageSize"]=>
int(65536)
["nindexes"]=>
int(1)
["lastExtentSize"]=>
float(65536)
["paddingFactor"]=>
float(1)
["paddingFactorNote"]=>
string(101) "paddingFactor is unused and unmaintained in 2.8. It remains hard coded to 1.0 for compatibility only."
["userFlags"]=>
int(0)
["capped"]=>
bool(true)
["max"]=>
int(9223372036854775807)
["maxSize"]=>
int(65536)
["totalIndexSize"]=>
int(8176)
["indexSizes"]=>
object(stdClass)#4 (1) {
["_id_"]=>
int(8176)
}
["ok"]=>
float(1)
}
Зміст
- MongoDB\Driver\Command::__construct— Створює новий об'єкт Command