Below is a simple example how I am using firebase:
let firebase = require('firebase');
firebase.initializeApp({
serviceAccount: './config/firebase.json',
databaseURL: 'https://thenameofhedatabase.firebaseio.com'
});
let db = firebase.database();
...
...
The point is that after all code execution the db
object holds the node.js session. I do not want to call process.exit(0)
. So, what is the right way to close or dispose the db
object of the firebase?