I have 2 models Country, City.
They are associated with each other. City Belongs to Country. Now what I want to do is get cities list within a country query along with limit and offset for pagination if possible.
If i do below it will list all cities within a country. What I need to do is be able to limit cities with limit and offset params.
Country.findById(1, {
include: [
{
model: City,
as: 'cities'
}
]
});
Run Code Online (Sandbox Code Playgroud)
Country …
sequelize.js ×1