MongoDB close connection

Hello to all
for my project I’m using MongoDB and the lucee driver.

I can’t understand how to close the connections.
I found the command:

db = MongoDBConnect ( dbName, dbString );
dump( db.command ( "serverStatus" ).connections );

to have the number of active, current and available connections:

Number of “current” grow up over and over and never decrease (even after many days).

How can close each connection that i open with MongoDbConnect?.
I was expecting a db.close()…

Can you help me?

Check this fro a few years ago.

https://lucee.daemonite.io/t/mongodb-extension/1759/5

Thank per hint Mark.
I’ll use application scope to reuse the connection.

but… how can I close active connections? :slight_smile:

If it’s in the application scope mongodb extension/driver manages the connections automatically.

In other words it re-uses the single connection which should not be closed.
Sorry it’s been a long time since I’ve used mongodb.