[CSHARP-3441] Get connection uri from current client. Created: 02/Mar/21  Updated: 31/Mar/22

Status: Backlog
Project: C# Driver
Component/s: Configuration
Affects Version/s: 2.11.6
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: 闽 彭 Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DRIVERS-821 Record Client connection URI Backlog
Backwards Compatibility: Fully Compatible

 Description   

I have a use case that need to backup / restore a collection in API.

The most convenient and fastest solution is mongodump / mongorestore. Seeing that there is no API in driver to call dump or restore, so I need to start a new process to do it.

Then I need to pass the current connection configuration to the mongodump / mongorestore. I don't want get the configuration from file or other way, because we have several ways to configure it (hard-code, config file, environment variable and so on). The most exact value should be read from the client.

 

I've read the sources. I think we may should store and provide the public property MongoUrl in MongoClientSettings.

What do you think about?



 Comments   
Comment by Dmitry Lukyanov (Inactive) [ 08/Mar/21 ]

Thanks pmznxxs@gmail.com for your report, you're right we don't have this functionality. One of the reasons for that is that connection string is not a single way to create a mongo client, but this looks like a valid feature request, so we will consider this work. Moving this ticket to our backlog

Generated at Wed Feb 07 21:45:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.