From cb38d6a02b3d364d384cf18b7109e1c51c43d494 Mon Sep 17 00:00:00 2001 From: wulan17 Date: Fri, 11 Jul 2025 20:31:21 +0700 Subject: [PATCH] pyrofork: docs: storage: Add example for official async mongodb driver Signed-off-by: wulan17 --- docs/source/topics/storage-engines.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/source/topics/storage-engines.rst b/docs/source/topics/storage-engines.rst index 4b89e31e..3fa29c46 100644 --- a/docs/source/topics/storage-engines.rst +++ b/docs/source/topics/storage-engines.rst @@ -80,7 +80,20 @@ Using async_pymongo (Recommended for python3.9+): print(await app.get_me()) -Using motor: +Using official mongodb driver: + +.. code-block:: python + + from pymongo import AsyncMongoClient + from pyrogram import Client + + conn = AsyncMongoClient("mongodb://...") + + async with Client("my_account", mongodb=dict(connection=conn, remove_peers=False)) as app: + print(await app.get_me()) + + +Using motor (Deprecated, but still works): .. code-block:: python