dao-xyz / peerbit

P2P database framework with encryption, sharding and search
https://peerbit.org
Apache License 2.0
196 stars 15 forks source link

`Documents`: Live query #200

Open marcus-pousette opened 1 year ago

marcus-pousette commented 1 year ago

It would be nice if one could make a query request, but make it live so new results are fed as they would match this query. Perhaps this is more like a synhronization filter rather than a query.

i.g.

const iterator =  await documents.index.iterate(new SearchRequest( ...criterias..., ...sort by... ), { keepAilve: 10* e3 })
while(let doc of await iterator)  // will run  for 10 seconds
{
    console.log("New doc", doc) 
 }