PHP Class Phalcon\Db\Adapter\MongoDB\Operation\CreateIndexes

See also: MongoDB\Collection::createIndex()
See also: MongoDB\Collection::createIndexes()
See also: http://docs.mongodb.org/manual/reference/command/createIndexes/
Inheritance: implements Phalcon\Db\Adapter\MongoDB\Operation\Executable
Afficher le fichier Open project: phalcon/incubator Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $databaseName, string $collectionName, array $indexes ) Constructs a createIndexes command.
execute ( MongoDB\Driver\Server $server ) : string[] Execute the operation.

Private Methods

Méthode Description
executeCommand ( MongoDB\Driver\Server $server ) Create one or more indexes for the collection using the createIndexes command.
executeLegacy ( MongoDB\Driver\Server $server ) Create one or more indexes for the collection by inserting into the "system.indexes" collection (MongoDB <2.6).

Method Details

__construct() public méthode

Constructs a createIndexes command.
public __construct ( string $databaseName, string $collectionName, array $indexes )
$databaseName string Database name
$collectionName string Collection name
$indexes array List of index specifications

execute() public méthode

For servers < 2.6, this will actually perform an insert operation on the database's "system.indexes" collection.
See also: Executable::execute()
public execute ( MongoDB\Driver\Server $server ) : string[]
$server MongoDB\Driver\Server
Résultat string[] The names of the created indexes