Commit aa31242e authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed script errors. [skip ci]

parent 7f09b831
Pipeline #48144 skipped
import sys
from nomad import infrastructure
from nomad import config
from nomad.migration import Package
from pymongo import MongoClient
from nomad.processing import Upload
infrastructure.setup_logging()
......@@ -8,6 +10,14 @@ infrastructure.setup_mongo()
sources = sys.argv[1:]
names = list(package.package_id for package in Package.objects(upload_id__in=sources))
targets = Upload.objects(name__in=names)
config.mongo.db_name = 'fairdi_nomad_migration'
client = infrastructure.setup_mongo()
client = MongoClient()
db = client['fairdi_nomad_migration']
collection = db['upload']
targets = collection.find({'name': {'$in': names}})
for target in targets:
print(targets.upload_id)
print(target['_id'])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment