Function - close()
This method closes the database connection.
Closing Connections
Occasionally, you may need to close a database connection from within a function, either as part of the operation or to close the connection to a different database.
Syntax
db.close()