Skip to content

Commit

Permalink
Merge pull request #19 from Jophish/mongo-contains
Browse files Browse the repository at this point in the history
feat(mongo): Implement contains for mongo cache
  • Loading branch information
JWCook committed Feb 23, 2021
2 parents 56b4bd3 + 8d55f64 commit c208ab4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions aiohttp_client_cache/backends/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ def __init__(self, db_name, collection_name: str, connection: MongoClient = None
async def clear(self):
self.collection.drop()

# TODO
async def contains(self, key: str) -> bool:
raise NotImplementedError
return bool(self.collection.find_one({'_id': key}))

async def delete(self, key: str):
spec = {'_id': key}
Expand Down

0 comments on commit c208ab4

Please sign in to comment.