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

passwordPrompt() (mongosh 메서드)

passwordPrompt()

Prompts for the password in mongosh. The entered password is not displayed in the shell. Use passwordPrompt() in conjunction with methods that accept password as a parameter instead of specifying the password in cleartext to those methods.

db.createUser() 에서는 비밀번호를 지정해야 합니다.

You can use passwordPrompt() as the value for the pwd instead of specifying the password.

db.createUser( {
user:"user123",
pwd: passwordPrompt(), // Instead of specifying the password in cleartext
roles:[ "readWrite" ]
} )

메시지가 표시되면 비밀번호를 입력합니다.

When you run the db.auth(<username>, <password>) command you can replace the password with the passwordPrompt() method.

db.auth(<username>, <password>) 명령에서 암호를 생략하면 사용자에게 암호를 입력하라는 메시지가 표시됩니다.

다음 예시 에서는 shell 에 표시되지 않는 비밀번호를 입력하라는 메시지를 사용자에게 표시합니다.

db.auth("user123")

db.changeUserPassword() 에서는 비밀번호를 지정해야 합니다.

You can use passwordPrompt() instead of specifying the password.

db.changeUserPassword("user123", passwordPrompt())

메시지가 표시되면 비밀번호를 입력합니다.

db.updateUser() 을(를) 사용하여 비밀번호를 변경하는 경우 이 메서드에서는 비밀번호를 지정해야 합니다.

You can use passwordPrompt() as the value for the pwd instead of specifying the password.

db.updateUser(
"user123",
{
pwd: passwordPrompt(),
mechanisms: [ "SCRAM-SHA-256" ]
}
)

메시지가 표시되면 비밀번호를 입력합니다.

이 페이지 평가하기

이 페이지의 내용