I'm trying to list menu log in my database in MongoDB and I'm not having success, however when I'm ready the records of Restaurant I'm successful, all two collections are in the same database, why will this be happening ?
This is my method that lists all the restaurants
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 the menu records
exports.getMenus = (req, res, next) => {
Menu
.find({})
.then(data => {
res.status(200).send(data);
}).catch(e => {
res.status(401).send(e);
})
};