patx/mongokv
added a close method. link to our new "docs" blog post in readme
Commit 508054f · patx · 2025-12-10T22:09:14-05:00
Comments
No comments yet.
Diff
diff --git a/README.md b/README.md
index 211ab7c..0640ecc 100644
--- a/README.md
+++ b/README.md
@@ -5,8 +5,7 @@ and is safe across multiple processes and workers thanks to MongoDB’s concurre
Is it a little pointless if you already know Mongo? Yeah. But if ya just want to
`set` and `get` without thinking about collections or schemas, it’s perfect. I made this
because [pickleDB](https://patx.github.io/pickledb) doesn't play nice with ASGI but I
-like its dumb API anyway :) There's no docs yet, so just look at the source code -
-its really short I promise.
+like its dumb API anyway :) [Read a little more about mkvDB in this blog post.](https://thoughts.harrisonerd.com/post/693a32cee5c413ce5f061c19)
```python
from mkvdb import Mkv
diff --git a/mkvdb.py b/mkvdb.py
index 1791e52..c92516e 100644
--- a/mkvdb.py
+++ b/mkvdb.py
@@ -84,3 +84,8 @@ class Mkv:
await self.collection.delete_many({})
return True
+ @dualmethod
+ async def close(self) -> None:
+ """Close the underlying MongoDB client."""
+ self.client.close()
+