Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to query for related data through REST? #195

Closed
RickEyre opened this issue Mar 14, 2018 · 1 comment
Closed

Is it possible to query for related data through REST? #195

RickEyre opened this issue Mar 14, 2018 · 1 comment

Comments

@RickEyre
Copy link

I'm wondering if it's possible, and if so how to query a service using feathers-sequelize where the where clause is a related model.

For example:

service.find('model').find({
  query: {
    relatedModel: {
      id: 'some-id'
    }
  }
);

This would pair with if you are including extra models on the server side to be joined and returned the front-end.

@RickEyre
Copy link
Author

Found the answer:

service.find('model').find({
  query: {
    '$relatedModel.id$': 'some-id'
    }
  }
);

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

No branches or pull requests

1 participant