Filtering in Realtime Subscriptions

{
    "type": "subscribe",
    "collection": "messages",
    "event": "update"
    "query": { "fields": ["text"] }
}

How to add “owner_id _eq owner1“ filter to the above realtime subscription so directus sends updated messages only to subscribed client with that filter?

Hello, @me14523

You can add filters in the query object using the filter key. For example:

{
  "type": "subscribe",
  "collection": "messages",
  "event": "update",
  "query": {
    "fields": ["text"],
    "filter": {
      "owner_id": {
        "_eq": "owner1"
      }
    }
  }
}