数据库导出脚本

This commit is contained in:
石皮幼鸟 2024-04-27 15:08:35 +08:00
parent 080078ee4f
commit 5a4fe2aea3
1 changed files with 17 additions and 0 deletions

17
mongoExport.sh Normal file
View File

@ -0,0 +1,17 @@
# 导出scoreInfo表
docker exec mongo mongoexport --db=catch-the-letters --out=catch-the-letters-scoreInfo.json --collection=scoreInfo -u main -p spynsql
# 导出user表
docker exec mongo mongoexport --db=catch-the-letters --out=catch-the-letters-user.json --collection=user -u main -p spynsql
# 导出level表
docker exec mongo mongoexport --db=catch-the-letters --out=catch-the-letters-level.json --collection=level -u main -p spynsql
# 导出version表
docker exec mongo mongoexport --db=catch-the-letters --out=catch-the-letters-version.json --collection=version -u main -p spynsql
# 从容器中拷贝出json文件
docker cp mongo:/catch-the-letters-scoreInfo.json ./catch-the-letters-scoreInfo.json
docker cp mongo:/catch-the-letters-user.json ./catch-the-letters-user.json
docker cp mongo:/catch-the-letters-level.json ./catch-the-letters-level.json
docker cp mongo:/catch-the-letters-version.json ./catch-the-letters-version.json