[CXX-2] Support for MongoDB URIs Created: 22/Jan/14  Updated: 08/Jul/14  Resolved: 03/Jul/14

Status: Closed
Project: C++ Driver
Component/s: API, Implementation
Affects Version/s: None
Fix Version/s: legacy-0.11.0

Type: Bug Priority: Critical - P2
Reporter: Timothy Byrd Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 2
Labels: C++, connection, driver, legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

C++ driver from 2.4.9 source (on Windows, though that shouldn't matter for this item). The 2.5.4 source does not look to be any different.


Issue Links:
Depends
is depended on by TOOLS-6 mongodump crashes with malformed --ho... Closed
Duplicate
is duplicated by CXX-272 Connection strings parsing changes fr... Closed
is duplicated by CXX-177 Support MongoDB URIs Closed
is duplicated by CXX-252 C++ Driver should support standard co... Closed
Related
related to SERVER-13867 Centralize validation of connection s... Closed

 Description   

The C++ driver does not accept connection strings that are URIs from http://docs.mongodb.org/manual/reference/connection-string/

We have configuration that is shared between apps that use the C++ driver and the C# driver. Because of this issue our work around would be to double-configure Mongo once for the C++ driver and once for everything else.

Unfortunately, there seems to be no documentation on what the C++ driver currently accepts. A google of "mongodb C++ driver connection string" gives this stack overflow question http://stackoverflow.com/questions/14629281/c-driver-mongodb-connection-options that basically says it's undocumented.

If MongoDB is not going to get the C++ driver up to snuff with the rest of the drivers, then please at least document how to translate from the URI syntax to something the C++ driver can understand.



 Comments   
Comment by Githook User [ 03/Jul/14 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: CXX-2 Implement support for connecting via mondodb:// URLs
Branch: legacy
https://github.com/mongodb/mongo-cxx-driver/commit/82bca967c8ca8c5c33a6856420eefc4140c396cf

Comment by Andrew Morrow (Inactive) [ 03/Jul/14 ]

https://github.com/mongodb/mongo-cxx-driver/pull/115

Comment by adrian [ 07/May/14 ]

thanks andrew
is it a simple matter of string dicing and slicing – from an older form to the newer form. or worse.
i found that c++ will not reconcile hostnames while python will reconcile the provided hostnames. thats using a replica set on azure. whatever the case, its sadly not possible to connect to a replica set for me. ive yet to try changing the hostnames to ip addresses in the rs.config. but the ips are dynamic and not static ones.

Comment by Andrew Morrow (Inactive) [ 31/Mar/14 ]

adrianb Yes I agree this is a very important issue to fix. It is currently slated for the legacy-0.9 release rather than the legacy-0.8 release because the legacy-0.8 release is focused on minimizing and stabilizing the driver in its new independent home, along with fixing critical issues related to being able to build a working driver library on various platforms and increasing test coverage. Without laying that groundwork, tackling new features and enhancements is a risky proposition.

So we have triaged all enhancements and new features into legacy-0.9. But that does not mean that we think that those features or enhancements are unimportant. I expect that CXX-2 will be one of the earlier enhancements issued once legacy-0.8 ships.

Comment by adrian [ 31/Mar/14 ]

in my opinion, this is a priority. i cannot connect to a replica set. i'm forced to use solutions that ... have the impact of making mongo slow.

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