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

filters without eager queries #86

Closed
devashishsethia opened this issue Mar 12, 2020 · 3 comments
Closed

filters without eager queries #86

devashishsethia opened this issue Mar 12, 2020 · 3 comments
Assignees

Comments

@devashishsethia
Copy link

Hi,

Does feathers-objection support using filters without using it in a eager query? Like how we can do with Objection:

class Person extends Model {
  static modifiers = {
    defaultSelects(query) {
      query.select('id', 'firstName');
    },

    filterGender(query, gender) {
      query.where('gender', gender);
    }
  };
}
const women = await Person.query()
  .modify('defaultSelects')
  .modify('filterGender', 'female');

It would be great if we can pass a $modify query parameter and use static modifiers.
Thanks.

@dekelev dekelev self-assigned this Mar 13, 2020
@dekelev
Copy link
Member

dekelev commented Mar 13, 2020

Thanks @devashishsethia , $modify is now supported in the latest version. check the docs for more info.

@dekelev dekelev closed this as completed Mar 13, 2020
@prashantnirgun
Copy link

Hi to community I am new to it can any one explain how to give call to $modify using post man I want to use this in GET request
from postman
GET localost:3000/perosn?$modify=filterGender=['gender', 'female'] its considering $modify as a column and adding it to where clause.

@devashishsethia
Copy link
Author

devashishsethia commented Jul 12, 2021 via email

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

No branches or pull requests

3 participants