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

오플로그 액세스

참고

This page applies to Atlas Infinite clusters and Atlas Core clusters. On an Atlas Infinite cluster, you can read the oplog collection as described on this page, but you can't set an oplog size. The collection serves change streams and some internal functions rather than replication, which the storage layer handles. To learn how the oplog behaves on an Atlas Infinite cluster, see Oplog on Atlas Infinite clusters.

특수 고정 사이즈 컬렉션, 즉 oplog는 데이터베이스에 저장된 데이터를 수정하는 작업을 기록합니다.

You must precede a $regex query on an oplog in a Free cluster or a Flex cluster with a carat (^). Otherwise, the following error occurs:

MongoServerError: Oplog ns RegEx queries must begin with ^

oplog에 액세스하려면 데이터베이스 사용자에게 local 데이터베이스에 대한 읽기 액세스 권한이 있어야 합니다. local에 대해 읽기 액세스 권한이 있는 사용자를 생성하려면 다음을 수행하세요.

1
  1. 아직 표시되지 않은 경우 탐색 표시줄의 Organizations 메뉴에서 프로젝트가 포함된 조직을 선택합니다.

  2. 아직 표시되지 않은 경우 내비게이션 바의 Projects 메뉴에서 프로젝트를 선택합니다.

  3. 사이드바에서 Security 제목 아래의 Database & Network Access를 클릭합니다.

The Database & Network Access page displays after you complete the preceding steps.

2
  1. 아직 표시되지 않은 경우 Database Users 탭을 클릭합니다.

  2. Add New Database User를 클릭하고 사용자 이름(예: oploguser)을 입력합니다.

  3. Grant Specific Privileges를 클릭하고 read 역할과 local 데이터베이스를 선택합니다. 이렇게 하면 사용자가 local 데이터베이스에 대한 작업을 읽지 못하도록 제한됩니다.

  4. 비밀번호를 입력하고 Add User를 클릭합니다.

  1. Connect to your cluster with the mongosh, using the credentials of the new database user with access to the local database.

  2. local 데이터베이스로 전환하세요.

    > use local
  3. oplog 컬렉션의 이름은 oplog.rs입니다. 데이터베이스 쓰기 작업은 타임스탬프 필드와 벽시계 필드와 함께 날짜 순서대로 기록됩니다.

    타임스탬프 필드 에는 에포크 이후 초가 표시된 정수가 포함됩니다.

참고

  • 클러스터에 대한 oplog의 크기를 늘리려면 Oplog 크기 설정을 참조하세요.

  • MongoDB 명령인 replSetResizeOplog를 사용하여 oplog 크기를 조정할 수 없습니다.