I am using feathers-reactive,
to get some data from a service and I subscribe to the result. When someone invites the user or he invites someone he should receive the updated data.
It does work when I specify the user_id in the query, but if I use a $or he starts to receive updates from all users all over the app
this.app
.service("friends")
.watch()
.find({
query: {
$or: [{ user_id: user.id }, { friend_id: user.id }] // this doesn't work
// user_id: user.id // this work
}
})
.subscribe(friends => console.log(friends));
Expected behavior
It should respect the filter
Actual behavior
It completely ignores the filter when using a $or
More context
I am posting a simple object like this using postman:
I am using feathers-reactive, to get some data from a service and I subscribe to the result. When someone invites the user or he invites someone he should receive the updated data. It does work when I specify the
user_id
in the query, but if I use a$or
he starts to receive updates from all users all over the appExpected behavior
It should respect the filter
Actual behavior
It completely ignores the filter when using a
$or
More context
I am posting a simple object like this using postman:
workaround
The thing I did to workaround was using channels to only publish the data if the user is in one of the fields: