mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-26 17:07:58 +03:00
19 lines
410 B
Bash
Executable File
19 lines
410 B
Bash
Executable File
#! /bin/bash
|
|
|
|
# Exports data from a mongodb instance back to the collections
|
|
# folder.
|
|
# Useful for backporting updates, or something.
|
|
|
|
set -eo pipefail
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
if [ -z "$1" ] || [ -z "$2" ]; then
|
|
echo "Usage: mongoexp.sh <collection> <dbname>"
|
|
exit
|
|
fi
|
|
|
|
mongoexport -d "$2" -c "$1" --jsonArray > ../collections/"$1".json
|
|
|
|
node remove-_id.js
|
|
node deterministic-collection-sort.js |