I’m using a Realm app to query my Atlas cluster through a HTTP Webhook.
My Service function is something like this:
exports = function(payload, response) {
const movies = context.services.get(“mongodb-atlas”).db(“sample_mflix”).collection(“movies”);
… Do some search related stuff here …
Everything is working fine but I see the connections (in the Atlas UI) to my cluster keep increasing. Started off at 2 a couple of days ago, and it is at 22 right now. I am the only person testing this app out right now, so there’s shouldn’t be too many connections.
Have read about connection pooling and closing connections after a time interval, but I can’t seem to find anyway to do that in the Webhook.
Any suggestions on how I can keep my connections from hitting the limit?