You are viewing an offline version of MongoDB documentation. Some page features might be unavailable. To view the latest version of the page or use interactive features, visit the live page.
MongoDB\Model\IndexInfo::isGeoHaystack()
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