Skip to content

Commit

Permalink
add export and import util to support v1 to v2 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
noqqe committed Jun 28, 2023
1 parent f0c82cf commit ca04ee1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions utils/export.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from pymongo import MongoClient
import os
import pymongo

CONNECTION_STRING = os.getenv("MONGODB_URI")
client = MongoClient(CONNECTION_STRING+'/admin')


# Create a new collection
collection = client["serra"]["cards"]

cards=collection.find()

for c in cards:
print("./serra add %s/%s -c %s" % (c["set"], c["collectornumber"], c["serra_count"]))

0 comments on commit ca04ee1

Please sign in to comment.