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

$gt (쿼리 자 연산자)

$gt

$gt 필드 값이 지정된 값(>)보다 큰 문서를 선택합니다.

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

  • MongoDB Atlas: 클라우드에서의 MongoDB 배포를 위한 완전 관리형 서비스

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

{ field: { $gt: value } }

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

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

이 예시 에서는 runtime 이 1000 분보다 큰 movies 컬렉션 에서 문서를 선택합니다.

db.movies.find( { runtime: { $gt: 1000 } }, { _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 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' }]

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

db.movies.updateMany( { "imdb.rating" : { $gt: 9.5 } }, { $set: { "highestRated": true } })
{ acknowledged: true, insertedId: null, matchedCount: 1, modifiedCount: 1, upsertedCount: 0}
이 페이지 평가하기