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
#!/bin/bash | |
# | |
# Easily switch your gcloud and kubectl CLIs to a different project. | |
# | |
# Usage: | |
# kubeswitch --project kashoo-stage | |
# --project | |
# accepted values: tsb-stage, tsb-prod, kashoo-stage, kashoo-prod | |
# | |
# For OSX, place contents in /usr/local/bin/kubeswitch |
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
# Finds documents from the "users" collection which have duplicate values for | |
# key "kazoo_id", and deletes as many as needed to keep only 1 document. | |
from pymongo.mongo_client import MongoClient | |
from pymongo.server_api import ServerApi | |
uri = "..." | |
client = MongoClient(uri, server_api=ServerApi('1')) | |
deleted = 0 |