9 lines
227 B
Bash
9 lines
227 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
for file in /docker-entrypoint-initdb.d/*.json; do
|
|
collection=$(basename "$file" .json)
|
|
echo "Importing $collection..."
|
|
mongoimport --db mydb --collection "$collection" --file "$file" --jsonArray
|
|
done
|