Skip to content
This repository has been archived by the owner on Oct 15, 2018. It is now read-only.

How can we filter by using child tables #134

Open
anaspa opened this issue Dec 15, 2016 · 0 comments
Open

How can we filter by using child tables #134

anaspa opened this issue Dec 15, 2016 · 0 comments

Comments

@anaspa
Copy link

anaspa commented Dec 15, 2016

Hi
How can we change the below one as

User.find()
.populate('pets')
.exec(function(err, users) {
if(err) // handle error

// The users object would look something like the following
// [{
// id: 123,
// firstName: 'Foo',
// lastName: 'Bar',
// pets: [{
// id: 1,
// breed: 'labrador',
// type: 'dog',
// name: 'fido',
// user: 123
// }]
// }]
});

to find all users who has pet type is dog

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant