CouchDB last SEQ change feed

I think I made a mistake here. Maybe someone can clarify I have an application that polls CouchDB for a long time (through nodejs), which uses the change source When my application first polls the change feed, it doesn't know last_ What is SEQ, so I just started to use self = = 0 polling to get last_ Seq then use since = last_ Seq polling

But I have a problem Since more documents have been added to my database, the change list becomes very long. When I use since = 0 to request changes, the response seems to be cut off, and I don't get the last in the response_ seq. Therefore, if there is no last_ Seq, I can't make a follow-up request

Is there any way to get last_ Seq instead of getting the change of aaaallll from the beginning? Is there a way to truncate and change feeds often?

Solution

Bah, it doesn't matter As usual, I found the answer immediately after publishing!

GET /dbname/_changes?descending=true&limit=1

How to get last created document in CouchDB?

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>