|
The MongoDB\Driver\Command classIntroductionThe MongoDB\Driver\Command class is a value object that represents a database command.
To provide Class synopsisMongoDB\Driver\Command
final
class MongoDB\Driver\Command
{
/* Methods */
final public __construct(arrayobject
}$document , arraynull $commandOptions = null )ExamplesExample #1 Composing MongoDB\Driver\Command to provide a helper to create collections
The above example will output: 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) }
|