Closed pepijndevos closed 2 years ago
Hey, I'm not sure I completely understand, but you want to access the sequence return from events in the changes endpoint?
In that case, the events should give access to it. The documentation seems a bit odd, but ChangedEvent and DeletedEvent both inherit from BaseChangeEvent, which contains the sequence.
When you pass update_seq
to a view (or _all_docs
) it will return the sequence that view was taken at, so you can request changes since then.
Looks like all existing methods in the View
class are generators. How would you imagine an interface for that?
Well up to you. I've written my app using aiohttp directly now.
Any time you're not returning the full CouchDB response you're making a trade-off between ergonomics and capability. In almost all cases CouchDB returns a map with an array in it, so to support the full API you'd have to expose some object with an iterator in it rather than just the iterator.
Have a look at #46. The ViewResponse
class should be what you're looking for.
Looks good!
I'm trying to use your quite lovely library, but unfortunately there is one huge problem, which is that there is no way to access the sequence number of a request, or the last sequence number of a changes feed.
This makes it basically impossible to fetch some documents, and then fetch the changes since that document was retrieved, and then the changes since you last requested the changes.