Thanks to visit codestin.com
Credit goes to github.com

Skip to content

docs: update Beanie examples to use PyMongo async client#1572

Open
sridhar-3009 wants to merge 1 commit into
fastapi-users:masterfrom
sridhar-3009:docs/update-beanie-async-client
Open

docs: update Beanie examples to use PyMongo async client#1572
sridhar-3009 wants to merge 1 commit into
fastapi-users:masterfrom
sridhar-3009:docs/update-beanie-async-client

Conversation

@sridhar-3009

Copy link
Copy Markdown

Problem

The Beanie database documentation still showed motor.motor_asyncio.AsyncIOMotorClient, but recent FastAPI Users / Beanie installations use PyMongo's native async client. This made the Beanie setup guide and examples look outdated.

Fixes #1559.

Solution

  • Replace Motor imports with pymongo.AsyncMongoClient in the Beanie documentation snippets.
  • Apply the same update to the Beanie and Beanie OAuth examples so the full examples stay consistent with the docs page.
  • Update the Beanie database guide wording and snippet highlight line numbers to match the shorter client setup.

Verification

  • ruff format --check docs/src/db_beanie.py docs/src/db_beanie_oauth.py docs/src/db_beanie_access_tokens.py examples/beanie/app/db.py examples/beanie-oauth/app/db.py
  • ruff check docs/src/db_beanie.py docs/src/db_beanie_oauth.py docs/src/db_beanie_access_tokens.py examples/beanie/app/db.py examples/beanie-oauth/app/db.py
  • python -m compileall docs/src examples/beanie/app examples/beanie-oauth/app

I also ran uv run --with mkdocs --with mkdocs-material --with mkdocs-mermaid2-plugin --with markdown-include --with pymdown-extensions --with pygments --with mike mkdocs build --strict. The docs rendered, but strict mode failed on existing warnings unrelated to this change: deprecated Material emoji config, missing old migration links, and missing anchors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Beanie outdated documentation

2 participants