Nuevo en la versión 1.4.
Definición
MongoDB\Model\IndexInfo::is2dSphere()Devuelve si el índice es un 2dsphere índice.
function is2dSphere(): boolean
Return Values
Un booleano que indica si el índice es un índice 2dsphere.
Ejemplos
$collection = (new MongoDB\Client)->getCollection('test', 'places'); $collection->createIndex(['pos' => '2dsphere']); foreach ($collection->listIndexes() as $index) { if ($index->is2dSphere()) { printf("%s has 2dsphereIndexVersion: %d\n", $index->getName(), $index['2dsphereIndexVersion']); } }
La vista de salida se ilustraría como sigue:
pos_2dsphere has 2dsphereIndexVersion: 3
Ver también
2Índices dsphere referencia en el manual de MongoDB