Skip to content

Commit 10832bb

Browse files
author
Shanee
committed
fix(mongodb): changed save and count to insert_one and count_documents
1 parent 875c5a2 commit 10832bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/scheduled/metrics.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
contributors = len(contributors)
2222

2323
# Number of Links
24-
links = db.links.count()
24+
links = db.links.count_documents()
2525

2626
# Number of Source sheets
27-
sheets = db.sheets.count()
27+
sheets = db.sheets.count_documents()
2828

2929
metrics = {
3030
"timestamp": datetime.datetime.now().replace(hour=0, minute=0, second=0, microsecond=0),
@@ -37,6 +37,6 @@
3737
}
3838

3939
try:
40-
db.metrics.save(metrics)
40+
db.metrics.insert_one(metrics)
4141
except DuplicateKeyError:
4242
pass

0 commit comments

Comments
 (0)