Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| wiki:mongodb [2024/04/10 19:00] – created none | wiki:mongodb [2025/04/07 17:26] (current) – 5.152.82.90 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| **Create** | **Create** | ||
| < | < | ||
| + | use admin | ||
| + | db.getUsers() | ||
| db.createUser({ user: ' | db.createUser({ user: ' | ||
| </ | </ | ||
| Line 7: | Line 9: | ||
| < | < | ||
| db.dropUser(' | db.dropUser(' | ||
| + | </ | ||
| + | **Dump** | ||
| + | < | ||
| + | mongodump --db=database --out=/ | ||
| + | mongodump --verbose --authenticationDatabase=admin mongodb:// | ||
| + | </ | ||
| + | **Restore** | ||
| + | < | ||
| + | mongorestore --db database --drop --verbose / | ||
| + | mongorestore --drop --verbose --authenticationDatabase=admin mongodb:// | ||
| </ | </ | ||