[CDRIVER-213] Modify api mongo_client to support passed in more hosts Created: 04/May/13  Updated: 11/Nov/13  Resolved: 11/Nov/13

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 0.90.0

Type: Improvement Priority: Major - P3
Reporter: Rock Li Assignee: Gary Murakami
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Major Change

 Description   

I think if we can modify the mongo_client api or create another api to let the users can passin more hosts nor the only one. like

mongo_client("localhost:27018,rock.mongodb.example.com");

This will break the backward compatibility, but looks more consistant with other drivers.

Especially it's convient when we can support auto failover and other more useful functionalities in the future?



 Comments   
Comment by Christian Hergert [ 11/Nov/13 ]

The new C driver[1] supports the MongoDB connection string format, which supports multiple hosts.

mongoc_client_t *client;
 
client = mongoc_client_new ("mongodb://localhost:27017,example:27017/?replicaSet=myreplicaset");

[1] https://github.com/chergert/libmongoc/

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