mongo init

This commit is contained in:
2025-10-06 16:52:56 +02:00
parent 5d5e882e56
commit 6fd4341ada
3 changed files with 29 additions and 0 deletions

8
mongo-init/01-import.sh Normal file
View File

@@ -0,0 +1,8 @@
#!/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