« Mongodb » : différence entre les versions
Apparence
Aucun résumé des modifications |
|||
Ligne 17 : | Ligne 17 : | ||
db.auth("username", passwordPrompt()) | db.auth("username", passwordPrompt()) | ||
</kode> | |||
= Installation = | |||
== Windows == | |||
<kode lang='ps'> | |||
choco install mongodb | |||
</kode> | </kode> |
Version du 8 mars 2023 à 09:17
Connect and authenticate
# connect
mongo mongodb://localhost:27017
# alias
mongo
# connect and authenticate, use an environment variable to hide the password
mongo "mongodb://user:${DBPASSWORD}@<host>:<port>/admin?authSource=admin"
|
Authenticate
Fichier:Mongo.svg | use admin db.auth("username", "pwd") db.auth("username", passwordPrompt()) |
Installation
Windows
choco install mongodb |