3
votes

I'm using the Sequelize package for node. I have a typical include on man to many relationship.

Item.findAll({
    include: {model: Blah: as 'blahs'}
});

All works well but it returns the set with the pivot data on each sub item. I don't need it. Is there any way to disable it or to specify the pivot fields needed?

2

2 Answers

7
votes

Found my answer:

{model: Model, as: 'model', through: {attributes: []}}
0
votes

It is not very clear what you are looking for but can you try adding raw:true

Item.findAll({
    include: {model: Blah, raw: true}
});

can you post the result you got vs result you want