Hi,
I am updating Couchbase Lite 1.x version to Couchbase Lite 3.x version in iOS Objective C.
I am having Couchbase Lite 1.x code written in programming language Objective -C.
Can any one tell me what will be the equivalent query of below code in CBLite 3.x
1)
CBLView *o_view=[o_db viewNamed:@“answerListing”];
[o_view setMapBlock: MAPBLOCK({
if ([doc[@“sys_type”] isEqualToString:kNewAnswerTableType]) {
emit(doc[@“_id”],doc);
}
}) reduceBlock:nil version: @“1.0”];
CBLQuery *o_query = [o_view createQuery];
2)
CBLView *view = [o_db viewNamed: @“userAnswerListingEref”];
[o_view setMapBlock: MAPBLOCK({
if ([doc[@“sys_type”] isEqualToString:kNewAnswerTableType]) {
emit(@[ doc[@“eRef”], doc[@“clientID”]], doc);
}
}) reduceBlock:nil version: @“1.0”];
CBLQuery *o_query = [o_view createQuery];