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

$gte(쿼리 자 연산자)

$gte

$gte 지정된 필드 의 값이 지정된 값보다 크거나 같은(>=) 문서를 선택합니다.

다음 환경에서 호스팅되는 배포에 $gte 사용할 수 있습니다.

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

$gte 연산자의 형식은 다음과 같습니다.

{ field: { $gte: value } }

부등 비교 연산자는 유형 브래키팅을 사용합니다. 즉, 특정 BSON 유형에 대한 비교는 다른 유형의 값을 필터링합니다.

이 페이지의 예시는 sample_mflix 데이터 세트의 데이터를 사용합니다. 이 데이터 세트를 자체 관리형 MongoDB 배포서버에 로드하는 방법에 대한 자세한 내용은 샘플 데이터세트 로드를 참조하세요. 샘플 데이터베이스를 수정한 경우, 이 페이지의 예시를 실행하려면 데이터베이스를 제거하고 다시 생성해야 할 수 있습니다.

이 예시 runtime 이 720 분 이상인 movies 컬렉션 의 문서를 선택합니다.

db.movies.find(
{ "runtime": { $gte: 720 } },
{ _id: 0, title: 1, runtime: 1, plot: 1 }
)
[
{
plot: 'The economic and cultural growth of Colorado spanning two centuries from the mid-1700s to the late-1970s.',
runtime: 1256,
title: 'Centennial'
},
{
plot: 'A dramatization of the missions and adventures of the greatest spy in British history.',
runtime: 720,
title: 'Reilly: Ace of Spies'
},
{
plot: "A 13-hour mini-series detailing James A. Michner's fictional account of the American space program from the years after World War II to the Apollo landings on the moon in the early 1970's.",
runtime: 780,
title: 'Space'
},
{
plot: 'A documentary on the history of the sport with major topics including Afro-American players, player/team owner relations and the resilience of the game.',
runtime: 1140,
title: 'Baseball'
},
{
plot: 'Taken spans five decades and four generations, centering on three families: the Keys, Crawfords, and Clarkes. World War II veteran Russell Keys is plagued by nightmares of his abduction by ...',
runtime: 877,
title: 'Taken'
}
]

이 updateMany() 작업은 rating라는 하위 필드가 있는 imdb이라는 내장된 문서와 일치합니다. rating 가 9.5 이상인 각 document 에서 { highestRated: true } 를 설정합니다.

db.movies.updateMany(
{ "imdb.rating" : { $gte: 9.5 } },
{ $set: { "highestRated": true } }
)
{
acknowledged: true,
insertedId: null,
matchedCount: 2,
modifiedCount: 2,
upsertedCount: 0
}

9.5보다 큰 imdb.rating가 있는 첫 번째 문서에서만 higestRated 필드를 설정하려면 updateOne()를 사용합니다.

이 페이지 평가하기