Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

adonis where has

// Testing code
var result = User.query()
    .with("posts", builder => {
      // Filter on the posts array
      builder.where("cond1", "2");
      builder.where("cond2", "3");
    })
    .whereHas("posts", builder => {
      // Filter user
      builder.where("cond1", "1");
      builder.where("cond2", "3");
    })
    .fetch();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #adonis
ADD COMMENT
Topic
Name
7+1 =