Skip to content

Add MONGO_URI Environment Variable Support #253

@anuragxxd

Description

@anuragxxd

Current Limitation

FOCA's MongoDB registration in foca/database/register_mongodb.py currently only supports individual environment variables (MONGO_HOST, MONGO_PORT, MONGO_USERNAME, MONGO_PASSWORD, MONGO_DBNAME) and constructs the MongoDB URI internally. This prevents users from providing complete MongoDB connection strings with advanced features like:

  • Replica sets with multiple hosts
  • SRV records
  • Custom connection options (SSL, read preferences, etc.)
  • Pre-constructed URIs from external secret management

Requested Enhancement

Add support for a MONGO_URI environment variable that, when present, takes precedence over individual component variables while maintaining full backwards compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions