Home Querying 3 entities with Sequelize
Reply: 0

Querying 3 entities with Sequelize

user575
1#
user575 Published in April 25, 2018, 5:08 am

I have 3 entities, I want to find a group of elements based on one parameter. Example:

A (id,...)  B (id, id_A)   C (id, ..., id_A, id_B)

I have already done all the relationships.

My goal is to insert in a query in javascript that takes in input A_id and the results are all B that containing C.

I try with something like that but I'm stuck:

return C.findAll({attributes: ['id','username'] ,
  where : {
    id_A : A.id
  }
}).then(C => {
  //I DON'T KNOW HOW TO CONTINUE
  })
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.385227 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO