globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 232 forks source link

feat: Added support for DNS Seedlist (mongodb+srv://) #385

Open harsh-2711 opened 4 years ago

harsh-2711 commented 4 years ago

Problem: Mongo v3.6 has added support for using DNS SRV records to configure the initial set of ReplicaSet instead of providing them in the main URI. This also lead to the problem of connection to MongoDB Atlas.

Solution: Updated extractURL function to support DNS SRV records and then use Seedlist to find the initial set of ReplicaSet.

Fixes: #112