EDIT [SOLVED]:
I was connecting to the wrong database...
I changed
var dbURI = \'mongodb://localhost/wifiplz\'
to
Dear,
make following changes :
var mongoose = require('mongoose');
var Location = mongoose.model('Location');
module.exports.locationRead = function(req, res) {
Location
.findOne({_id: req.params.locationId}, function (err, location){
if (err) throw err;
res.status(200);
res.json(location); // returns null
});
}
_id could be your any field so replace your db field with _id but make sure that field should be primary in nature or unique. If it's not create an index over that field
Thanks & Cheers