I used to apply the following PouchDB pattern and I would be happy to have an equivalent with an instance of the couchdb-howler client.
From what I understand, the actual couchdb-howler client is able to receive changes from a database but it can not:
Get changes of a database, based on a selector, since 0 and get last_seq in response (one shot)
Listen to changes of the previous database, based on the previous selector, since last_seq (live)
PouchDB pattern
So the idea is to first get all the changes related to a selector, then get back the last_seq fetched by this selector and use it to listen lively, since last_seq, changes matching the selector. This way, we can build a sync reduction of the matched documents, ready to use for the UI part.
In the following example, the database name and selector are not really important, they are only used to show how the logic works.
Context
I used to apply the following PouchDB pattern and I would be happy to have an equivalent with an instance of the
couchdb-howler
client.From what I understand, the actual
couchdb-howler
client is able to receive changes from a database but it can not:last_seq
in response (one shot)last_seq
(live)PouchDB pattern
So the idea is to first get all the changes related to a selector, then get back the
last_seq
fetched by this selector and use it to listen lively, sincelast_seq
, changes matching the selector. This way, we can build a sync reduction of the matched documents, ready to use for the UI part.In the following example, the database name and selector are not really important, they are only used to show how the logic works.
Do you think it is something implementable? :crossed_fingers: