-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add a script to cleanup mongo smpcv2 collections (#360)
- Loading branch information
1 parent
06218e0
commit 78d2e83
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |