문서 메뉴

문서 홈PHP 라이브러리 매뉴얼

MongoDB\Model\IndexInfo::isGeoHaystack()

이 페이지의 내용

  • 정의
  • 반환 값
  • 예제
  • 다음도 참조하세요.

버전 1.4에 새로 추가되었습니다.

버전 1.16부터 폐지 : MongoDB 5.0 이상에서는 더 이상 geoHaystack 인덱스를 지원하지 않습니다.

MongoDB\Model\IndexInfo::isGeoHaystack()

Return whether the index is a geoHaystack index.

function isGeoHaystack(): boolean

인덱스가 geoHaystack 인덱스인지 여부를 나타내는 부울입니다.

<?php
$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']);
}
}

이 경우 출력은 다음과 유사합니다:

pos_geoHaystack_x_1 has bucketSize: 5
← MongoDB\Model\IndexInfo::is2dSphere()