Created
October 16, 2023 18:44
-
-
Save Ne00n/682f855342ff618fb8557892c3888ad2 to your computer and use it in GitHub Desktop.
basedflare cluster sync
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
#python3 cluster.py http://admin:admin@localhost:2001/,http://admin:admin@localhost:2001/ | |
from pymongo import MongoClient | |
import sys | |
client = MongoClient() | |
client = MongoClient("mongodb://127.0.0.1:27017/") | |
dbs = client.list_database_names() | |
print(f"Updating cluster to {[sys.argv[1]]}") | |
db = client['test'] | |
collection = db['accounts'] | |
collection.update_one({'_id':'admin'}, {"$set": {"clusters": [sys.argv[1]]}}, upsert=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment