MongoDB\Model\IndexInfo::isGeoHaystack()
On this page
New in version 1.4.
Deprecated since version 1.16: MongoDB 5.0 and later no longer supports geoHaystack indexes.
Definition
MongoDB\Model\IndexInfo::isGeoHaystack()
Return whether the index is a geoHaystack index.
function isGeoHaystack(): boolean
Return Values
A boolean indicating whether the index is a geoHaystack index.
Examples
$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']); } }
The output would then resemble:
pos_geoHaystack_x_1 has bucketSize: 5
See Also
geoHaystack Indexes reference in the MongoDB manual