How to use LiveQuery to get only modified documents?

query

#1

Hi There,

I would like to get documents which are only modified based on date time in LiveQuery. What is the live query for that? For me all the documents are coming every time even documents are modified or not


#2

Unfortunately this is simply the way that live query works. It will run periodically and if the results change it will send you the updated result set.


#3

Thanks for letting know us.


#4

you can use database change listener to track change of the documents changed. Live query runs above a query and fires only when the result of that query have changed. But it will always produce the complete result set and not the difference.


#5

Sounds interesting, but what i observed is… i am getting duplicate documents on database change listener. i will cross verify.


#6

It’s not duplicate documents but different revisions of the same document. So once you get the batch make that batch unique (create a set of unique document ids) and then use it as per requirement.


#7

Yes same document with different revisions. can you please share document link about batch unique or crate as set of unique document ids in couchbase documents.