0

In my Android app I use Couchbase Mobile have a LiveQuery running that gives me a subset of my model.

Sometimes I get an object from it and update it with document.putProperties(updatedProps).

I've noticed that my query doesn't give another result, even if the values emitted in my map function are different. In fact, the map function isn't invoked until I close my query and start another one.

The only thing I can think of is that my queries are made (in this case) with setMapOnly set to true.

Any ideas why is this happening? Thanks!

Test Devices: Nexus 5 (5.0.1 Lolllipop) and Shield Tablet (5.0.1 Lollipop) Couchbase Lite version: 1.0.3.1 and 1.0.4

Serandel
  • 417
  • 5
  • 20
  • Debugging a little more, what happens is that the change listener added to the database in LiveQuery.start() is not called at all... – Serandel Jan 19 '15 at 11:46
  • I think the live query change listener should be added to the query object, not the database. Can you share the code to set up the live query? Are you using a map/reduce view or the all docs query? You can find more about live queries at http://developer.couchbase.com/mobile/develop/guides/couchbase-lite/native-api/query/index.html#live – jamiltz Apr 13 '15 at 06:26

1 Answers1

0

Check out this thread: https://forums.couchbase.com/t/android-livequery-changeevent-getrows-not-returning-original-data/6908/2?u=bundee

The page is also misrepresenting the event as being about document changes, when it's really about view index changes. Or rather, the event triggers because the results of the query change. Depending on what the view's map function indexes, it's possible for a document to change without altering the query results. Or a document change could cause multiple query rows to change.

So this LiveQuery concept is really not as helpful as i thought it would be....

Bundeeteddee
  • 724
  • 11
  • 19