Skip to content
masterclass Buddy

Pydantic · Type Alias

MongoDsn

MongoDsn validates MongoDB connection strings in Pydantic. It accepts mongodb and mongodb+srv URLs, with optional credentials, database names, and ports.

Last updated

Syntax

MongoDsn

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • AnyUrl
  • MultiHostUrl
  • UrlConstraints
  • PostgresDsn
  • RedisDsn

Source: Network Types | Pydantic Docs. Checked 2026-11-03.