Skip to content

DSNs Including DB Name #1861

Closed
Closed
@derekrprice

Description

@derekrprice

My Mongo DSN looks like mongodb://mongo:27017/dbname. Using this configuration yields an error about "$databaseName is not defined":

'mongo' => [
    'driver' => 'mongodb',
    'dsn' => 'mongodb://mongo:27017/dbname',
]

Adding a database name to the configuration works around the issue, but it is redundant with the information in the URL:

'mongo' => [
    'driver' => 'mongodb',
    'dsn' => 'mongodb://mongo:27017/dbname',
    'database' => 'dbname',
]

All our other environments in both PHP & JS work just fine with only the DSN and no DB name specified, including ones using the same base PHP Mongo driver. database should not be required with a full dsn.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions