CatchTheLettersBackend/mongoExport.sh

18 lines
943 B
Bash

# 导出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