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

startSession(데이터베이스 명령)

startSession

The startSession command starts a new logical session for a sequence of operations.

In mongosh, this command can also be run through the Mongo.startSession() helper method.

Helper methods are convenient for mongosh users, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command.

이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.

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

참고

이 명령은 모든 MongoDB Atlas 클러스터에서 지원됩니다. 모든 명령에 대한 Atlas 지원에 관해 자세히 알아보려면 지원되지 않는 명령을 참조하세요.

명령은 다음과 같은 구문을 가집니다:

db.runCommand(
{
startSession: 1
}
)

To run startSession, use the db.runCommand( { <command> } ) method.

db.runCommand(
{
startSession: 1
}
)

중요

featureCompatibilityVersion startSession명령을 사용하려면 3.6 이상이어야 합니다.

If the deployment enforces authentication/authorization, you must be authenticated to run the startSession command. The user who runs startSession owns the created session, and only that user can use the session.

배포서버에서 인증/권한 부여를 적용하지 않는 경우, 생성된 세션에는 소유자가 없으며 모든 연결의 모든 사용자가 사용할 수 있습니다. 사용자가 인증/권한 부여를 적용하지 않는 배포서버에 대해 세션을 인증하고 생성하는 경우, 사용자가 세션을 소유합니다. 그러나 모든 연결의 모든 사용자가 세션을 사용할 수 있습니다.

다운타임 없이 배포가 인증으로 전환되면 소유자가 없는 세션을 사용할 수 없습니다.

세션은 세션을 생성한 MongoClient 객체에만 사용할 수 있습니다. 단일 세션은 동시에 사용할 수 없습니다. 단일 세션을 사용하는 작업은 순차적으로 실행해야 합니다.

In addition to the status and operation time of the command, the startSession returns the following session specific information:

필드
유형
설명

id

문서

세션 식별자의 16바이트 UUID(Universally Unique Identifier) 부분을 포함하는 문서입니다.

id: { id: <UUID> }

세션의 식별자는 이 UUID와 인증된 사용자 자격 증명의 해시로 구성됩니다.

timeoutMinutes

숫자

마지막 클라이언트 사용 이후 세션이 만료되기 전에 활성 상태로 유지된 시간(분)입니다. 기본적으로 세션의 만료 시간은 30분입니다. 이 값을 변경하려면 localLogicalSessionTimeoutMinutes 을(를) 시작할 mongod 때 매개변수를 설정하세요. 복제본 세트 및 샤드 cluster의 경우 모든 구성원에 동일한 값을 지정해야 합니다.

이 페이지 평가하기

이 페이지의 내용