1

I have a query that looks like this:

User.find({
include: {
    relation: 'Comment',
    scope: {
        where: {
            text: {
                like: '%some text'
            }
        }
    }
}

}, function (err, users) { ... })

Everything works great, but i want to be able to query only the users that commented "some text", like a inner join.

How can i do that?

Diego
  • 11
  • 1
  • If everything works great what specifically is the issue? Are you searching for "some text" exactly and this is pulling in something else? If so what is it pulling up in addition to "some text"? – JSimonsen Aug 19 '15 at 18:22
  • Yes, it's pulling users that wrote something else, but without a comment object associated. I would like to query only the users that commented "some text" e leave the other users outside the result. What is happening is that loopback is left joining users with comments on text like '%some text', I want to do a inner join instead, with sequelize i would put a required: true parameter within the include, is there anything like that in loopback? – Diego Aug 23 '15 at 20:55

0 Answers0