diff --git a/src/regolith/commands.py b/src/regolith/commands.py index 2208e35bf..121dd1664 100644 --- a/src/regolith/commands.py +++ b/src/regolith/commands.py @@ -25,7 +25,7 @@ def add_cmd(rc): """Adds documents to a collection in a database.""" - rc.client[rc.db] + db = rc.client[rc.db] db[rc.coll] docs = [json.loads(doc) if isinstance(doc, string_types) else doc for doc in rc.documents] rc.client.insert_many(rc.db, rc.coll, docs)