var historyQuesn = [];
db.collection('history_QUESTIONS').find({}).toArray().then((docs)=>{
var historyquesn = JSON.stringify(docs,undefined,2);
var historyquesn_parse = JSON.parse(historyquesn);
historyQuesn = historyQuesn.concat(historyquesn_parse);
},(err)=>{
console.log(err);
});
I want to make use of the array returned by the above query in another functions. I want to make use of the documents returned by the db.find() method in some another functions using nodejs! Basically i want to use the vlaue of 'historyQuesn' in another functions. Please Help!