Skip to content

Commit

Permalink
Update load.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
althausLuca authored Jul 26, 2024
1 parent b4ee8fc commit 22c24a5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions systems/mongodb/load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,20 @@ elapsed_time=$(echo "$end_time - $start_time" | bc)
echo "Loading time: $elapsed_time seconds" > loading_time_$dataset.txt

### create a index on the time field
docker exec -it mongodb mongo --eval 'db.getSiblingDB("d1").d1.createIndex({ time: 1 });'
docker exec -it mongodb mongo --eval 'db.getSiblingDB("d1").d1.getIndexes();'
container_name="mongodb"

# Check if mongo is available
if docker exec -it $container_name mongo --version > /dev/null 2>&1; then
docker exec -it $container_name mongo --eval 'db.getSiblingDB("d1").d1.createIndex({ time: 1 });'
docker exec -it $container_name mongo --eval 'db.getSiblingDB("d1").d1.getIndexes();'
fi

# Check if mongosh is available
if docker exec -it $container_name mongosh --version > /dev/null 2>&1; then
docker exec -it $container_name mongosh --eval 'db.getSiblingDB("d1").d1.createIndex({ time: 1 });'
docker exec -it $container_name mongosh --eval 'db.getSiblingDB("d1").d1.getIndexes();'
fi


echo "comression"
sh compression.sh

0 comments on commit 22c24a5

Please sign in to comment.