How do you perform a simple inner join without eagerly loading the results of the JOIN table in Sequelize?
The following query correctly joins the books table and only returns records that have an associated books record, great.
I don't want the data from the books table to be populated in the dataset though.
Example:
If the parent model is say: a shelf. I want to find all the shelves that currently have any books in them...but I do not want to return all the book data, I just need the parent shelf records.
this.getModel().findAll(
{
include: [
{
model: this.db.getModel('books'),
required: true,
}
]
});
How do I just return the parent table data based on the join? The docs are very confusing.