Nuevo en la versión 1.4.
Obsoleto desde la versión 1.16: MongoDB 5.0 y versiones posteriores ya no admiten índices geoHaystack.
Definición
MongoDB\Model\IndexInfo::isGeoHaystack()Devuelve si el índice es un geoHaystack index.
function isGeoHaystack(): boolean
Return Values
Un valor booleano que indica si el índice es un índice geoHaystack.
Ejemplos
$collection = (new MongoDB\Client)->selectCollection('test', 'places'); $collection->createIndex(['pos' => 'geoHaystack', 'x' => 1], ['bucketSize' => 5]); foreach ($collection->listIndexes() as $index) { if ($index->isGeoHaystack()) { printf("%s has bucketSize: %d\n", $index->getName(), $index['bucketSize']); } }
La vista de salida se ilustraría como sigue:
pos_geoHaystack_x_1 has bucketSize: 5
Ver también
Índices geoHaystack referencia en el manual de MongoDB