Skip to content

RUST-1048 support something like get_default_database from client? #475

Closed
@WindSoilder

Description

@WindSoilder

Let's say that I have the following code:

use mongodb::sync::Client;
let cli = Client::with_uri_str("mongodb://localhost:21017/test_db").unwrap();

It's good that we can fetch default database like this:

assert_eq!(cli.get_default_databse(), Some("test_db"));

If I have the following code:

use mongodb::sync::Client;
let cli = Client::with_uri_str("mongodb://localhost:21017/").unwrap();

then cli.get_default_database can return None.

Connection string reference: https://docs.mongodb.com/manual/reference/connection-string/

Metadata

Metadata

Assignees

Labels

tracked-in-jiraTicket filed in Mongo's Jira system

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions