21 lines
911 B
Text
21 lines
911 B
Text
|
エクスポート
|
||
|
|
||
|
$ docker exec -i taiko-mongo mongoexport --db taiko --collection users --out /dev/stdout | sort -n > users.json
|
||
|
$ docker exec -i taiko-mongo mongoexport --db taiko --collection songs --out /dev/stdout | sort -n > songs.json
|
||
|
$ docker exec -i taiko-mongo mongoexport --db taiko --collection scores --out /dev/stdout | sort -n > scores.json
|
||
|
|
||
|
コミット&プッシュ
|
||
|
|
||
|
$ git add *.json
|
||
|
$ git commit --author="BOT <bot@example.com>" -m "$(git diff --name-only --cached | paste -s -d ' ') が更新されました"
|
||
|
$ git push origin main
|
||
|
|
||
|
インポート
|
||
|
|
||
|
$ docker cp users.json taiko-mongo:/a
|
||
|
$ docker exec -i taiko-mongo mongoimport --db taiko --collection users /a
|
||
|
$ docker cp songs.json taiko-mongo:/b
|
||
|
$ docker exec -i taiko-mongo mongoimport --db taiko --collection songs /b
|
||
|
$ docker cp scores.json taiko-mongo:/c
|
||
|
$ docker exec -i taiko-mongo mongoimport --db taiko --collection scores /c
|