yjs / y-websocket

Websocket Connector for Yjs
https://docs.yjs.dev/ecosystem/connection-provider/y-websocket
MIT License
497 stars 256 forks source link

Filter results on request #120

Closed zzph closed 1 year ago

zzph commented 1 year ago

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

Additional context

Huly®: YJS-531

dmonad commented 1 year ago

Hi @zzph ,

Something like this is definitely not possible in Yjs for technical reasons (you can't fetch a subset of data). However, you can use subdocuments (see documentation) to achieve the same thing.