AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.
Docs Menu

$maxDistance (쿼리 자 연산자)

$maxDistance

The $maxDistance operator constrains the results of a geospatial $near or $nearSphere query to the specified distance. The measuring units for the maximum distance are determined by the coordinate system in use. For GeoJSON point objects, specify the distance in meters, not radians. You must specify a non-negative number for $maxDistance.

The 2dsphere and 2d geospatial indexes both support $maxDistance: .

다음 예제 쿼리는 점 [ -74 , 40 ] 로부터 10 이하의 단위 떨어진 위치 값을 가진 문서를 반환합니다.

db.places.find( {
loc: { $near: [ -74 , 40 ], $maxDistance: 10 }
} )

MongoDB는 [ -74 , 40 ] 으로부터의 거리를 기준으로 결과를 정렬합니다. cursor.limit() 메서드로 쿼리를 수정하지 않는 한 이 작업은 처음 100개의 결과를 반환합니다.

이 페이지 평가하기

이 페이지의 내용