Hi,
I have following query builder, When i run this query, i am getting 5 documents. So i changed one document out of 5 documetns. But in LiveQuery Change listener i am getting 5 records again instead of only one records, which are changed recently.
So how to get only changed records from the query in change listener?
-
(OR)
is Querybuilder reexecture, if any values changed on query?
livequeryForCompleted = QueryBuilder .select(SelectResult.all()) .from(DataSource.database(CouchbaseSingleton.shared.database!)) .where(Expression.property( CBConstants.kDocumentType).equalTo(Expression.string(documenttype)) .and(Expression.property(CBConstants.kID).equalTo(Expression.string(id))) .and(Expression.property(CBConstants.kdpIsProcessed).equalTo(Expression.boolean(true)))) if let query = livequeryForCompleted{ do { let result = try query.execute() let resullist : [Result] = result.allResults() Print.print("isProgress true count \(resullist.count)") } catch{ } completedListenerToken = query.addChangeListener { (change) in for (i,output) in change.results!.enumerated() { print("\(i+1). isProgress true Docs is \(output.toDictionary())") } } }