简体   繁体   中英

filter fields from response with feathersjs

I would like to be able to provide the fields I want to select as a query param. Something like this: http://localhost:3030/users?select[]=email . Than I could remove the fields in a after hook or better tell sequelize just to fetch this fields.

So far I tried the after hook wich does not work since the query params are passed to sequelize which causes an error (since there is no select field in the database).

Is there a recommend way to accomplish this feature ?

Ok, this is already supported by feathers-query-filter:

That works: http://localhost:3030/users ?$select[]=id

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM