mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: docs: storage: Add example for official async mongodb driver
Some checks failed
Pyrofork / build (macos-latest, 3.10) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.11) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.12) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.13) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.9) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.10) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.11) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.12) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.13) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.9) (push) Has been cancelled
Some checks failed
Pyrofork / build (macos-latest, 3.10) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.11) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.12) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.13) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.9) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.10) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.11) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.12) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.13) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.9) (push) Has been cancelled
Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
parent
cf6141feb4
commit
cb38d6a02b
1 changed files with 14 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue