Getting Started with MongoDb Compass
Official download address (free product, but no Chinese page) https://www.mongodb.com/try/download/compass
Then there are not too many functions, but it is still refreshing.
Then you can modify the data more intuitively
Mongodb data backup and recovery
For more information, please refer to the official website document
- https://www.mongodb.com/docs/database-tools/mongodump/
- https://www.mongodb.com/docs/database-tools/mongorestore/
- https://www.mongodb.com/docs/database-tools/mongoimport/
- https://www.mongodb.com/docs/database-tools/mongoexport/
data backup
The reference command to initiate a backup is as follows
mongodump -h localhost:27017 -d grasscutter -o /root/genshin/sql
Where -h is the connection IP:port to mongodb, -d is followed by the database name, -o is followed by a folder directory, preferably a blank folder
Then it can be seen that the backup file is not a single file
Data Recovery
If you want to modify the database name, it is better to use this method instead of directly modifying it.
The reference command is as follows
mongorestore -h localhost:27017 -d gc /root/genshin/sql/grasscutter
Where -h is the connection IP:port to mongodb, -d is followed by the database name (other names can be customized, and does not need to be consistent with the original library), and a folder directory at the end (you can also use –dir to specify the backup directory) , just like the backup above
In addition, you can also add –drop (when restoring, delete the current data first, and then restore the backed up data) or you can manually clear it yourself
combat effect
The new library is found to be slightly smaller, which may be an index problem
Data export and import via Studio 3T
Note that compass does not support batch exporting the entire library.
With json, it can be used all the way by default, and other formats should also work
The resulting effect is shown in the figure
Then import back to another library
Then I found that the previous blank table was not restored, but skipped directly.
This article is reprinted from https://www.blueskyxn.com/202209/6590.html
This site is for inclusion only, and the copyright belongs to the original author.