balderdashy / waterline-docs

WARNING: The content in this repo is out of date! See https://github.com/balderdashy/sails-docs for the most up-to-date documentation
452 stars 161 forks source link

Get objects filtered by values depending on a relationships filter #76

Closed washimimizuku closed 9 years ago

washimimizuku commented 9 years ago

Is it possible to make a query where I get records depending on the values of a relationships fields?

For example, this, which doesn't work:

{ 
    skip: 0,
    limit: 10,
    sort: 'id asc',
    where: { 
        or: [  
            { 'company.name': { contains: 'Admin' } },
            { name: { contains: 'Gru' } }
         ]
     }
}

What I would like to happen is to get all records where company.name contain 'Admin', that is the part I am not being able to do.

Is there a way to do this? Thanks

dmarcelino commented 9 years ago

Hi @washimimizuku, this is not possible (yet). There is an open feature request for this which you can track at balderdashy/waterline#266.

washimimizuku commented 9 years ago

Ok, thanks, I'll watch it