FYI Im using Couchbase-Lite and yeah the documentation could do with some love :-)
I tried group_level: GET http://localhost:5984/ajaikhattri_seen/_design/fabric/_view/seen?group_level=1 Output: { "total_rows": 1, "offset": 0, "rows": [ { "id": null, "key": "ryan", "value": 1 } ] } 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. Also dont know if I need to worry about rereduce? On Tuesday, February 24, 2015 at 3:52:38 PM UTC-5, Jens Alfke wrote: > > > On Feb 24, 2015, at 9:24 AM, Eno <[email protected] <javascript:>> wrote: > > My understanding is that reduce only happens when group=true is supplied > via query string right? > > > If the view has a reduce function defined, queries will reduce by default > unless you add ?reduce=false. > > So Im calling GET on > http://localhost:5984/database/_design/fabric/_view/seen?group=true > > > You need to use ?group_level=1. (The boolean ?group query isn’t needed; as > far as I know, it’s an unnecessary evolutionary relic from old versions of > CouchDB.) > > The best documentation of the REST API for queries is CouchDB’s > <http://docs.couchdb.org/en/latest/api/ddoc/views.html>. (I apologize for > our comparable docs > <http://developer.couchbase.com/mobile/develop/references/couchbase-lite/rest-api/design-document/get---db--design--design-doc--view--view-name-/index.html> > being, > um, somewhat less comprehensive. Fortunately the API is basically the > same.) But we do have good documentation on the principles of querying > <http://developer.couchbase.com/mobile/develop/guides/couchbase-lite/native-api/query/index.html#grouping>, > > including grouping. > > —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/5d3965fb-3d4f-4ae0-9a6d-201932d60bb2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
