Skip to content

Commit c3a59e2

Browse files
Zhuoying ZhuZhuoying Zhu
authored andcommitted
pymongo count test
1 parent 9c09818 commit c3a59e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

atomate/utils/database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __init__(
119119
self.collection = self.db[collection]
120120

121121
# set counter collection
122-
if self.db.counter.find({"_id": "taskid"}).count() == 0:
122+
if self.db.counter.count_documents({"_id": "taskid"}) == 0:
123123
self.db.counter.insert_one({"_id": "taskid", "c": 0})
124124
self.build_indexes()
125125

0 commit comments

Comments
 (0)