简体   繁体   中英

how to use feathersjs filter service?

Hi I don't understand what is filter service and how it use. I updated my node, npm package and all node_modules. Now, when I have been creating new service I getting new file and it's look:

/* eslint no-console: 1 */
console.warn('You are using the default filter for the users service. For more information about event filters see https://docs.feathersjs.com/api/events.html#event-filtering'); // eslint-disable-line no-console

module.exports = function (data, connection, hook) { // eslint-disable-line no-unused-vars
  return data;
};

how to use it and what the filtering service is for?

The filters service is for filtering the events which are emitted from your service. For example, let's say you have a Members service. When a member is created in your service the 'created' event will be emitted to all connected users by default. By using filters you can limit which users receive those events - you may want only the users which belong to the same group as the new member to receive that event. See this link for more details on Events in Feathers https://docs.feathersjs.com/api/events.html

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