db(database).listCollection().toArray(function (error, isListCollection){if(error){response.json(error.message)}else if(isListCollection){for(var i = 0; i < isListCollection.length; i++){const listColl = isListcoll.name; db(database).collection(listColl, (error, data) => { if(errr){responden.json(error.message)}else if(data){respons.json(data)});}
How to loop and push the respon data to Json file. Thanks