Thanks for the link to the code. That's awesome! I haven't used grouping at all yet, so it's great to see it in use.
Thanks! Brendan On Wednesday, March 23, 2016 at 8:19:00 PM UTC-6, Jens Alfke wrote: > > > On Mar 23, 2016, at 7:49 PM, Brendan Duddridge <[email protected] > <javascript:>> wrote: > > But then my map view table would actually contain all this duplicate data > taking up space that it didn't need to? > > > Yeah, but often you can use the same view/index for multiple queries. For > example, I wrote a little demo app a long time ago that stores your iTunes > library’s metadata in a database and lets you browse it; this one view > allows it to query for the Artists list, the Albums list, and track list of > the selected album, and the total time duration of whatever’s selected. The > query just needs to change the group level. > > > NSString* artist = doc[@"Artist"]; > NSString* name = doc[@"Name"]; > if (artist && name) { > if ([doc[@"Compilation"] boolValue]) { > artist = @"-Compilations-"; > } > emit(@[artist, > doc[@"Album"] ?: [NSNull null], > doc[@"Track Number"] ?: [NSNull null], > name, > @1], > doc[@"Total Time"]); > } > > (full source of the view definition here > <https://github.com/couchbaselabs/iOS-WorkerBee/blob/master/Tests/Test13_ITunesIndex.m>; > > I’m not sure where the rest of the app ended up.) > > —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/7999cbee-4487-457d-bd22-4a51c7ab4bea%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
