# pydantic 2.14.2 (MIT), harvested by tools/harvest_corpus.py
=== input
A type that will accept any MongoDB DSN.

    * User info not required
    * Database name not required
    * Port not required
    * User info may be passed without user part (e.g., `mongodb://mongodb0.example.com:27017`).

    !!! warning
        If a port isn't specified, the default MongoDB port `27017` will be used. If this behavior is
        undesirable, you can use the following:

        ```python
        from typing import Annotated

        from pydantic_core import MultiHostUrl

        from pydantic import UrlConstraints

        MongoDsnNoDefaultPort = Annotated[
            MultiHostUrl,
            UrlConstraints(allowed_schemes=['mongodb', 'mongodb+srv']),
        ]
        ```
    
=== parse google
short_description: 'A type that will accept any MongoDB DSN.'
long_description: |
  * User info not required
  * Database name not required
  * Port not required
  * User info may be passed without user part (e.g., `mongodb://mongodb0.example.com:27017`).
  
  !!! warning
      If a port isn't specified, the default MongoDB port `27017` will be used. If this behavior is
      undesirable, you can use the following:
  
      ```python
      from typing import Annotated
  
      from pydantic_core import MultiHostUrl
  
      from pydantic import UrlConstraints
  
      MongoDsnNoDefaultPort = Annotated[
          MultiHostUrl,
          UrlConstraints(allowed_schemes=['mongodb', 'mongodb+srv']),
      ]
      ```
blank_after_short_description: True
blank_after_long_description: False
style: google
=== detect
rest
=== compose google
A type that will accept any MongoDB DSN.

* User info not required
* Database name not required
* Port not required
* User info may be passed without user part (e.g., `mongodb://mongodb0.example.com:27017`).

!!! warning
    If a port isn't specified, the default MongoDB port `27017` will be used. If this behavior is
    undesirable, you can use the following:

    ```python
    from typing import Annotated

    from pydantic_core import MultiHostUrl

    from pydantic import UrlConstraints

    MongoDsnNoDefaultPort = Annotated[
        MultiHostUrl,
        UrlConstraints(allowed_schemes=['mongodb', 'mongodb+srv']),
    ]
    ```
