Кажется, что в sailsjs вы можете запускать и передавать только один набор данных запроса за раз. Например, вот контроллер моей домашней страницы:
module.exports = {
index: function (req, res) {
Blog.find()
.limit(3)
.sort('createdAt desc')
.where({ isPublished: 1 })
.exec(function(err, posts) {
if (err) return next(err);
res.view({
layout: "homeLayout",
posts:posts
});
});
}
};
Как я могу запросить данные из какой-либо другой модели и передать ее моему представлению вместе с данными блога, которые я уже пропустил?