Using Monoskin in Express route I'm doing the following:
router.get(/getbuyerinfo, function(req, res) {
    var data = "data";
    db.collection('buyerRec').find().toArray(function(err, result) {
        if (err) throw err;
        console.log(result);
        db.collection('buyerHistory').find().toArray(function(err, result) {
            if (err) throw err;
            console.log(result);
            console.log(data);
        });
    });
});   
It's actually much deeper. But in an attempt to clean up the deep callbacks, in the most straight forward and quickest manner, even if not the most modern way, I created:
router.get(/getbuyerinfo, getBuyerRec);
function getBuyerRec(req, res) {
    var data = "data";
    db.collection('buyerRec').find().toArray(getBuyerHistory);
}
function getBuyerHistory(err, result) {
    if (err) throw err;
    console.log(result);
    db.collection('buyerHistory').find().toArray(function(err, result) {
        if (err) throw err;
        console.log(result);
        console.log(data);
    });
}
My problem is that 'data' is no longer in scope. The 'data' value came from the Express router.get(). How do I pass 'data' to the getBuyerHistory function so I can use it?
 
    