db.auth()

db.auth("username", "password")
参数:
  • username (string) – Specifies an existing username with access privileges for this database.
  • password (string) – Specifies the corresponding password.

Allows a user to authenticate to the database from within the shell. Alternatively use mongo --username and --password to specify authentication credentials.

MongoDB Manual (Index)

关于

生态系统

格式

资源