Skip to content

Commit

Permalink
fix: Add a script to cleanup mongo smpcv2 collections (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciechsromek authored Sep 19, 2024
1 parent 06218e0 commit 78d2e83
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/delete_mongodb_mpcv2_collections.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -e

CONNECTION_STRING="$1"

DATABASE="iris"
COLLECTIONS="mpcv2.results mpcv2.results.partial mpcv2.results.deletion deletion.requests"

for COLLECTION in $COLLECTIONS; do
echo "Deleting collection $COLLECTION from database $DATABASE..."
mongosh "$CONNECTION_STRING" --eval "db.getCollection('$COLLECTION').drop()"
done

echo "MPC collections deleted successfully."
12 changes: 12 additions & 0 deletions scripts/purge_stage_mongo_collections.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

printf "\n=============================="
printf "\nActivate teleport tunnel to mongo_db iris and delete collections\n"

tsh login --proxy=teleport.worldcoin.dev:443 --auth=okta
tsh db login --db-user developer-read-write mongo-atlas-iris-stage --db-name iris
tsh proxy db --tunnel mongo-atlas-iris-stage -p 60003 --db-user arn:aws:iam::510867353226:role/developer-read-write &

sleep 5

./delete_mongodb_mpcv2_collections.sh "mongodb://127.0.0.1:60003/iris?serverSelectionTimeoutMS=10000"

0 comments on commit 78d2e83

Please sign in to comment.