javascript - Find all instances of "modelA" with no asscociated instances of "modelB" using sequelize -


i using sequelize, node.js module.

i want findall instances of modela have no associated instances of modelb.

each instance of modela hasmany instances of modelb.

this current attempt not working.

modela.findall({   logging: console.log,   where: {     //- number of modelb === 0?   }   include: [     {       model: modelb,       where: {         //- doesn't exist?       },     },   ], }) 

i included logging: console.log, show needs output single mysql query can run elsewhere, why i'm not filtering users in next promise in promise chain after returning users.

this should work

modela.findall({   logging: console.log,   include: [     {       model: modelb,       where: {         modela_id: {$ne: null}       },     },   ], }) 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -