Result incorrect on android with compound keys filtering

66 views
Skip to first unread message

michiel...@co-capacity.org

unread,
Apr 10, 2014, 1:03:34 PM4/10/14
to mobile-c...@googlegroups.com
I tried the documented way and created sample code in this gist:

https://gist.github.com/MichielBijland/9809dd2269bc2279d896

View is indexing just fine :
 V/Database﹕ emit(["location/SEN/delta","Wet"], "Sahel 328")
 V/Database﹕ emit(["location/SEN/delta","Wet"], "Sahel 305")

but the count returns 0, I have been starring at this problem for hours, probably something silly.

Kind regards,
Michiel








Jens Alfke

unread,
Apr 10, 2014, 1:41:50 PM4/10/14
to mobile-c...@googlegroups.com
Hm, that code looks correct to me, though I’m not very familiar with the Java API. Maybe Traun can see something I missed.

What happens if you don’t set the startKey or the endKey, i.e. you query every row in the view? Do you get anything?
(My usual tactic when I get stuck on a bug is to start varying the initial conditions to see if the behavior changes; this often provides clues. Debugging is a lot like scientific experimentation!)

—Jens

Traun Leyden

unread,
Apr 10, 2014, 2:28:36 PM4/10/14
to mobile-c...@googlegroups.com

Nothing jumps out at me either, so I've asked @andreibaranouski to look into creating a unit test for this.  


@Jens - if you know of any existing iOS tests that cover this behavior, that would be a helpful pointer.




--Jens

--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/C0F9946B-293B-4C32-88C2-400258B7E73C%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

michiel...@co-capacity.org

unread,
Apr 10, 2014, 4:20:43 PM4/10/14
to mobile-c...@googlegroups.com
Without no start or end key, i get every row from the view correctly. I'll try some more debugging tomorrow.

Thxs for looking into it,
Michiel

Op donderdag 10 april 2014 19:41:50 UTC+2 schreef Jens Alfke:

michiel...@co-capacity.org

unread,
Apr 11, 2014, 3:08:49 AM4/11/14
to mobile-c...@googlegroups.com
I'm very sorry after some extensive debugging and stepping through the code I found the problem this morning.
There was a case issue in the id of the locations, sometimes they got all lower case and sometimes last word got it's first letter uppercased.

So nothing wrong with your code ;)

Thank you for your time and support.

Kind regards,
Michiel
Reply all
Reply to author
Forward
0 new messages