Hi,

How can i check the existence of my views when the app is launched , if 
it's not the will be created ,
like :

 //********** customer View search:

    

    CBLView* view = [self.database viewNamed: @"client/docView"];

    [view setMapBlock: ^(NSDictionary* doc, void (^emit)(id key, id value)) 
{

        NSString* type = [doc objectForKey: @"type"];


        NSArray * value = [NSArray arrayWithObjects:

                         [doc objectForKey: @"id"],

                         [doc objectForKey: @"description1"],

                         nil];

        if ([type isEqualToString:@"CLIE"]) emit([doc objectForKey:@"_id"], 
value);

  } version: @"1.0"];

    

    //*********** product varianty


   view = [self.database viewNamed: @"prodVersion/docView"];

    [view setMapBlock: ^(NSDictionary* doc, void (^emit)(id key, id value)) 
{

        NSString* type = [doc objectForKey: @"type"];

        

        NSArray * value1 = [NSArray arrayWithObjects:

                           [doc objectForKey: @"code"],

                           [doc objectForKey: @"id"],

                           [doc objectForKey: @"versionCode"],

                           nil];

        if ([type isEqualToString:@"product"]) emit([doc objectForKey:@"_id"], 
value1);

    } version: @"1.0"];


because when i insert new doc and i do get to the view, the result is not 
updating, i have to reopen the app to have the view updated !!

Thanks
Nadia ECHI

-- 
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/6ae34e0d-f1a8-40bd-aaae-af4786598e73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to