Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wiki:mongodb [2024/10/17 11:42] – 5.152.82.90 | wiki:mongodb [2025/04/07 17:26] (current) – 5.152.82.90 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| **Create** | **Create** | ||
| < | < | ||
| + | use admin | ||
| db.getUsers() | db.getUsers() | ||
| db.createUser({ user: ' | db.createUser({ user: ' | ||
| Line 11: | Line 12: | ||
| **Dump** | **Dump** | ||
| < | < | ||
| - | mongodump --db=database_src | + | mongodump --db=database |
| + | mongodump --verbose --authenticationDatabase=admin mongodb:// | ||
| </ | </ | ||
| **Restore** | **Restore** | ||
| < | < | ||
| - | mongorestore --db database_dest | + | mongorestore --db database |
| + | mongorestore --drop --verbose --authenticationDatabase=admin mongodb:// | ||
| </ | </ | ||