Hello,
    I have several documents and I classify them by "type" for instance, 
let's say we want to retrieve only documents related to users, type=user.
    How do I query by type?
   My MAPFUNCION looks like this but it seems not to be working as it 
doesn't retrieve any row.


- (void)usersCBView {

    

    [[self.database viewNamed: @"users"] setMapBlock: MAPBLOCK({

        id DocType = [doc objectForKey: @"type"];

        if (DocType == (id) @"user")

            emit(@[doc[@"id"], doc[@"pwd"], doc[@"usercategory"], doc[
@"name"]], nil);

    }) version: @"1.1"];

    

}


Any help is very well appreciated,

BR

Sandra

-- 
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/336a9e65-9ccd-4851-b71d-0f8f2e088af8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to