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

db.logout() (mongosh 메서드)

db.logout()

버전 5.0부터 더 이상 사용되지 않습니다.

Attempting to use the db.logout() method will write an error message to the log once per logout attempt.

이 메서드는 향후 릴리스에서 제거될 예정입니다.

현재 인증 세션을 종료합니다. 현재 세션이 인증되지 않은 경우 이 함수는 효과가 없습니다.

참고

If you're not logged in and using authentication, db.logout() has no effect.

Because MongoDB allows users defined in one database to have privileges on another database, you must call db.logout() while using the same database context that you authenticated to.

If you authenticated to a database such as users or $external, you must issue db.logout() against this database in order to successfully log out.

예시

Use the use <database-name> helper in mongosh, or the following db.getSiblingDB() method in an interactive mongosh session or in mongosh shell scripts to change the db object:

db = db.getSiblingDB('<database-name>')

When you have set the database context and db object, you can use the db.logout() to log out of database as in the following operation:

db.logout()

db.logout() function provides a wrapper around the database command logout.

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

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

참고

This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.

이 페이지 평가하기

이 페이지의 내용