Sure. Here's the iOS code sample. the original Java sample is
here: https://gist.github.com/joshblour/3fb6bc5aa0a5a4c72e20
CBLView* view = [db viewNamed: @"all_friend_requests_by_sender"];
if (!view.mapBlock) {
// Register the map function, the first time we access the view:
[view setMapBlock: MAPBLOCK({
if ([doc[@"type"] isEqualToString:kFriendRequestDocType]) {
emit(@[doc[@"fromUUID"], doc[@"toUUID"], doc[@"updatedAt"]],
doc[@"status"]);
}
}) reduceBlock: nil version: @"2"]; // bump version any time you
change the MAPBLOCK body!
}
CBLQuery *query = [view createQuery];
query.startKey = @[[self myUUID]];
query.endKey = @[[self myUUID], @{}, @{}];
On Friday, November 20, 2015 at 6:58:47 PM UTC+1, Jens Alfke wrote:
>
>
> > On Nov 19, 2015, at 6:22 AM, Yonah Forst <[email protected]
> <javascript:>> wrote:
> >
> > I've tried with the start key as an array and get the same results
>
> Could you show an example? Perhaps showing the code that creates the
> query?
>
> --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/03e31030-1408-4e56-893f-59dd8652567b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.