Filter results on request
zzph opened this issue · 1 comments
zzph commented
Hi, firstly thanks for this awesome project Checklist
Is your feature request related to a problem? Please describe. I would like a way to query just a subset of the data from yjs. For simplicity, presume it’s a todo list and we want to filter out “completed “ items.
Describe the solution you'd like Ability to request filtered yjs results (instead of the entire "room"). Query could be passed via the socket eg ws:foo.com/my-room?name=bar
, then the filtering itself is done in JS server-side before sending
Describe alternatives you've considered
- attempted to modify
y-socket
todecode
& filter a result before sending it (such as here). - doing 2 requests (first req is a
rest
responds with indexes of subset items, second req is toyjs
and asks for only those indexes). - each “item ” is a different room, but seems like a big overhead (performance) If even possible (multiplex)?
- change data format, using either
y.Array
ory.Set
Additional context
- Do not want to 'break' yjs ability 'new' items (eg
new Y.Array().push(...)
) - Do not want to 'hear' (eg events/updates) about docs I'm not subscribed to