2025-10-06 16:52:56 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -e
|
|
|
|
|
|
2025-10-06 22:08:23 +02:00
|
|
|
for file in /initdb.d/commandes/*.json; do
|
2025-10-06 16:52:56 +02:00
|
|
|
collection=$(basename "$file" .json)
|
|
|
|
|
echo "Importing $collection..."
|
|
|
|
|
mongoimport --db mydb --collection "$collection" --file "$file" --jsonArray
|
|
|
|
|
done
|