Best way to refactor connection overhead from my handler functions?

Hi Divjot,
I’m using the first method you said (a global Mongo client) but I got the connections going higher Even if I set a maximum to the pool it goes beyond it and I think this because the connections don’t get returned to the pool and I can’t find a way to close or return to the pool the connection used by functions.

i have wrote a topic with more info if you can help me.
thanks in advance