StephenBlackWasAlreadyTaken / xDrip

Android Application that collects dex signals, allows calibrations, and uploads
GNU General Public License v3.0
207 stars 176 forks source link

Support for MongoDB ReplicaSet/Cluster (e.g. MongoDB Atlas) #192

Open arm80s opened 6 years ago

arm80s commented 6 years ago

Would it be possible to add support for uploading to MongoDB ReplicaSets and Clusters (as available with MongoDB Atlas' hosted offering). The URI string connect string is in a slightly different format, e.g.:

mongodb://admin:<PASSWORD>@my-cluster-shard-00-00.mongodb.net:27017,my-cluster-shard-00-01.mongodb.net:27017,my-cluster-shard-00-02.mongodb.net:27017/<DATABASE>?ssl=true&replicaSet=My-Cluster-shard-0&authSource=admin

/blob/master/app/src/main/java/com/eveningoutpost/dexdrip/Services/MongoWrapper.java: line 32

dbUriStr_ = dbUriStr;
// dbName is the last part of the string starting with /dbname
dbName_ = dbUriStr.substring(dbUriStr.lastIndexOf('/') + 1);