From 5d3da1cc0db6190bc0768b3f8bbb99407f04f882 Mon Sep 17 00:00:00 2001 From: wulan17 Date: Sun, 21 May 2023 01:14:11 +0700 Subject: [PATCH] async_pymongo: Add README Signed-off-by: wulan17 --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 5483f55..18d3539 100644 --- a/README.md +++ b/README.md @@ -1 +1,23 @@ +## async_pymongo Asynchronous wrapper for pymongo + +### Installing + +``` bash +pip3 install async_pymongo +``` + +### Usage + +``` python +from async_pymongo import AsyncClient + +async def main(): + conn = AsyncClient("mongodb://...") + db = conn["database_name"] + col = db["collections_name"] + await col.insert_one({"name": "John Smith", "age": 25}) + async for data in col.find({}): + print(data["name"]) +``` + The rest function are same with pymongo but with await