Connecting MongoDB Serverless instance with mongodb_driver (

Hi !!,

I have question about MongoDB connection,… thanks in advance

I failed to connect to the MongoDB Cluod Serverless instance with mongodb-driver deps.

When I try to connect to the instance using URL ,
Mongo.start_link(url: “mongodb+srv://”)

it shows the warning and error message …

15:07:32.169 [warning] Description: ‘Authenticity is not established by certificate path validation’
Reason: ‘Option {verify, verify_peer} and cacertfile/cacerts is missing’

15:07:32.344 [error] Mongo.MongoDBConnection (#PID<0.241.0>) failed to connect: ** (Mongo.Error) The server is being accessed through a load balancer, but this driver does not have load balancing enabled 354

When I tried to connect using the tool “MongoDB Compass”, there is no problem…

Is there any solution to solve it…??


I don’t know anything about this library but are you sure you’re using the exact same URL that you’re using with MongoDB Compass? If so do you have the latest version of mongodb_driver? (The changelog hints that this type of URL hasn’t always been supported).