I've been attempting to access a specific field returned from the mongodb collection.find method without success. The console.log is not displaying anything.
router.get('/buildings', function(req, res, next) {
var db = req.db;
var collection = db.get('buildings');
collection.find({buildingNO:"1"},{},function(e,docs){
var x=docs[0].price;
console.log(x);
});
});
Note: I'm using monk middle-ware instead of native mongodb
Thank you!