I am using:
“org.mongodb.scala” %% “mongo-scala-driver” % “2.9.0”,
Connecting to a local mongodb works just fine but fails when trying to access Atlas with the following error:
{“ok”: 0, “errmsg”: “The server is being accessed through a load balancer, but this driver does not have load balancing enabled”, “code”: 354, “codeName”: “LoadBalancerSupportMismatch”}
My connection code is simple:
val mongoUri = “mongodb+srv://USER:PASSWORD@jpgnftdb.ld9qh.mongodb.net/myFirstDatabase?retryWrites=true&w=majority”
val mongoClient: MongoClient = MongoClient(mongoUri)
val database: MongoDatabase = mongoClient.getDatabase(mongoDBName)
The same connection string works fine from Nodejs