Skip to content

Commit

Permalink
Use latest pymongo in cache CI and update count to count_documents (#631
Browse files Browse the repository at this point in the history
)

Co-authored-by: Rhys Campbell <rhyscampbell@bluewin.ch>
  • Loading branch information
rhysmeister and rhysmeister authored Feb 20, 2024
1 parent 82d7f39 commit da977d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mongodb-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
with:
timeout_minutes: 3
max_attempts: 3
command: pip install pymongo==3.12.2
command: pip install pymongo

- name: Run ansible to generate the mongodb cache
run: ansible localhost -m setup
Expand Down
2 changes: 1 addition & 1 deletion plugins/cache/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def keys(self):

def contains(self, key):
with self._collection() as collection:
return bool(collection.count({'_id': self._make_key(key)}))
return bool(collection.count_documents({'_id': self._make_key(key)}))

def delete(self, key):
del self._cache[key]
Expand Down

0 comments on commit da977d6

Please sign in to comment.