Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## mongo shell
- ```bash
- mongo --shell
- show dbs
- use amniat
- show tables
- db.users.find()
- db.users.updateOne(
- { "name" : "ashkan" },
- { $set: { "type" : "admin" } }
- );
- ```
- ## mongodb backup
- * to backup:
- ```bash
- mongodump --out ./acs-27-Azar-1397 --db acs
- ```
- * to restore:
- ```bash
- mongorestore ./acs-27-Azar-1397
- ```
- * to move the backup:
- ```bash
- rsync -aih --progress --log-file=[destination]/ingest.log [source] [destination]
- rsync -aih --progress --log-file=./ingest.log username@ip:/root/backups/acs-27-Azar-1397 ./
- ```
Add Comment
Please, Sign In to add comment