MongoParseError: Load balancer mode requires driver version 4+

Viewed 484

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.

1 Answers

if u want to use serverless mongo. mongoose version should be higher than 6. To fix the above issue update the mongoose

npm install mongoose@6.5.3

Related