Guest User

Untitled

a guest
Dec 18th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. ## mongo shell
  2.  
  3. ```bash
  4. mongo --shell
  5. show dbs
  6. use amniat
  7. show tables
  8. db.users.find()
  9. db.users.updateOne(
  10. { "name" : "ashkan" },
  11. { $set: { "type" : "admin" } }
  12. );
  13. ```
  14.  
  15. ## mongodb backup
  16.  
  17. * to backup:
  18. ```bash
  19. mongodump --out ./acs-27-Azar-1397 --db acs
  20. ```
  21.  
  22. * to restore:
  23. ```bash
  24. mongorestore ./acs-27-Azar-1397
  25. ```
  26.  
  27. * to move the backup:
  28.  
  29. ```bash
  30. rsync -aih --progress --log-file=[destination]/ingest.log [source] [destination]
  31. rsync -aih --progress --log-file=./ingest.log username@ip:/root/backups/acs-27-Azar-1397 ./
  32. ```
Add Comment
Please, Sign In to add comment