Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoParseError: Load balancer mode requires driver version 4+

I have built a loopback 3 app with mongodb, worked perfectly on local and vps. But I wanted to opt for the SaaS (mongodb.com and heroku.com) and now I am facing an error:

    /node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/utils.js:698
          throw error;
          ^

MongoParseError: Load balancer mode requires driver version 4+

I have updated the loopback-connector-mongodb, installed mongodb 4.4.0 through npm and made sure of the compatibility.

P.S: since I am using the shared plan from mongodb.com, I cannot turn off the load balancer.

like image 354
Haythem Avatar asked Aug 16 '26 00:08

Haythem


1 Answers

If you want to use serverless Mongo. Mongoose version should be higher than 6. To fix the above issue, update Mongoose:

npm install [email protected]
like image 134
karthik Avatar answered Aug 17 '26 20:08

karthik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!