Nuevo en la versión 1.4.
Definición
MongoDB\Model\IndexInfo::is2dSphere()Devolver si el Ãndice es un 2 Ãndice de dsphere.
function is2dSphere(): boolean
Return Values
Un booleano que indica si el Ãndice es un Ãndice 2dsphere.
Ejemplos
$collection = (new MongoDB\Client)->selectCollection('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
2dsphere Ãndices referencia en el manual de MongoDB