Here is an example of a query:
static NSString* const kSCLabTagIdView = @"SCLabTagIdView";
CBLDatabase* database = [[CBLManager sharedInstance]
existingDatabaseNamed:kLabReferenceDatabase error:nil];
CBLView* view = [database viewNamed:kSCLabTagIdView];
if(!view.mapBlock) {
[view setMapBlock:MAPBLOCK({
if([doc[@"type"] isEqualToString:NSStringFromClass([LGTag
class])] && doc[@"title"]) {
emit(doc[@"tagId"], nil);
}
}) version:kApplicationVersionString];
}
return [view createQuery];
and I use it:
self.labTagIdQuery = [[self.reference queryLabTagId] asLiveQuery];
self.labTagIdQuery.limit = 30;
[self.labTagIdQuery addObserver:self forKeyPath:@"rows" options:0
context:NULL];
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return [self.labTagIdQuery.rows count];
}
With the new code, count is 0, whereas with the older codebase, it worked
as expected. I've reverted back to the old code, and everything works as
expected, so unclear what changed in this new code base to make my queries
not perform as expected.
On Thursday, July 17, 2014 12:00:28 AM UTC-7, Jens Alfke wrote:
>
>
> On Jul 16, 2014, at 9:32 PM, Ragu Vijaykumar <[email protected]
> <javascript:>> wrote:
>
> Hmm, I just updated to this new code and all of a sudden, none of my
> CBLQuerys are returning any rows. I haven't changed anything else in my
> database. Is there something new that I need to do with these changes.
>
>
> No, everything should still work. What do your map functions and queries
> look like?
>
> —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/4c955e79-2f41-4967-b251-c70278cb97a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.