OK time to slap my head a few times :-)
I think when doc.comments is 0 then if (doc.threadId && doc.comments) ==
false and then those rows fail to be emitted :-)
Changing my map to if (doc.threadId) { emit(doc.threadId, doc.comments) }
seems to work.
Many thanks for your help.
On Tuesday, February 24, 2015 at 5:05:46 PM UTC-5, Jens Alfke wrote:
>
>
> On Feb 24, 2015, at 1:15 PM, Eno <[email protected] <javascript:>> wrote:
>
> The key "ryan" is one of the threadIds but there are actually two
> threadId's and 8 documents in total.
> The value of "value" appears to be the correct total for all ryan's
> threads.
>
>
> Hm, weird. Try querying the view with ?reduce=false to see what all of the
> rows in the view are. It may be that for some reason the other rows didn’t
> get emitted.
>
> Also dont know if I need to worry about rereduce?
>
>
> The ‘total’ function happens to be one that will work fine with rereduce
> with no extra work. (Totaling up a bunch of totals produces the right
> answer, thanks to the associative property of addition.) But yes, many
> reduce functions do have to behave differently when the ‘rereduce' flag is
> set.
>
> —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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/20a13739-3f43-4487-ba80-2eed451df3af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.