I was able to create a MAPBLOCK for my view, and enabled logging in TouchDB, but I'm getting no results from the query. I tried the same query in futon, and it is working ok. I also checked the TouchDB with SQLite Viewer in FireFox, and it contains data. Here is from the log:
I'm moving my code to Objective-C instead of MonoTouch, but I'm getting some issues where for some queries, I don't get any results.
My other queries/views seems to work ok, but some similar to this I always get zero results. It is because of the id format?
All:
design = [db designDocumentWithName: @"photo"];
[design defineViewNamed:@"_all" mapBlock: MAPBLOCK({
NSString* docId = [doc objectForKey: @"_id"];
if ([docId rangeOfString:@"photo-"].location == 0)
emit(nil, nill);
}) version: @"1.0"];
Filtered:
design = [db designDocumentWithName: @"photo"];
[design defineViewNamed:@"by-guestid" mapBlock: MAPBLOCK({
NSString* guestId= [doc objectForKey: @"GuestId"];
if (guestId)
emit(guestId, doc);
}) version: @"1.0"];
Noong Huwebes, Agosto 02 2012 11:32:00 UTC+8, si Jens Alfke ay sumulat:
Hmm, is it a problem if I have only one key in a startkey/endkey but it has square brackets?
It seems that was the issue sir. It was working with Couchbase mobile, though...