0
I’m trying to list the menu record in my Mongodb database and am not succeeding, but when I list the Restaurant records I succeed, all two collections are in the same database, why is this happening?
This is my method that list all Resturant
exports.get = (req, res, next) => {
Restaurant
.find({})
.then(data => {
res.status(200).send(data);
}).catch(e => {
res.status(401).send(e);
})
};
And this is the method for listing menu entries
exports.getMenus = (req, res, next) => {
Menu
.find({})
.then(data => {
res.status(200).send(data);
}).catch(e => {
res.status(401).send(e);
})
};
Is there an error? The variable
exports
is being exported in the module?– Costamilam