On Apr 21, 2014, at 2:34 PM, amir nikfar <[email protected]> wrote:

> this is work fine and and the allDocument have my array of note and it is ok
> but i want to group my note with their name and count of each group
> in sql this is something like this: SELECT count(*),name FROM note group by 
> name

To group together all the rows with the same key, set the groupLevel property 
of the query to 1. The result will give you one row for each unique key, with a 
nil value.

If you want something in the value, like the count, you'll need to add a reduce 
function. The reduceBlock would look like
        REDUCEBLOCK({ return @(values.count); })

--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/322E7E7A-B459-47AE-909C-B02EBFDFC2D6%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to