How can I edit the result of changeStream in loopback?

224 views Asked by At

I am using loopback and I need to edit the default result of the changeStream in one of my models.

Is there any hook to do this? Something like:

MyModel.observe('changeStream', function filterProperties(ctx, next) {})

or

MyModel.beforeRemote('*', ...);

By default i get this response:

"{"target":"1234","where":{"id":"1234"},"data":{"$inc":{"counter":1}},"type":"update"}"

i want for to count every match with these id and return it

Any help would be appreciated.

0

There are 0 answers