couchbase-lite-ios icon indicating copy to clipboard operation
couchbase-lite-ios copied to clipboard

setMapBlock is executing for all CBLView s instead of specific mentioned CBLView

Open SravanPeddi opened this issue 3 years ago • 3 comments

I am having 4 CBLViews (AData, BData, CData,DData) when i am trying to access below method using AData CBLView it is executing for all the CBLViews created.

  • (BOOL) setMapBlock: (CBLMapBlock)mapBlock reduceBlock: (nullable CBLReduceBlock)reduceBlock version: (NSString*)version;

    CBLView *aView = [database existingViewNamed: @"AData"]; [aView setMapBlock: MAPBLOCK({ NSLog(@"doc[type] %@",doc[@"type"]); if ([[doc[@"title"] lowercaseString] containsString:[@"abc" lowercaseString]]) { emit(CBLTextKey(@"content"),doc[@"masterId"]); break; }

    }) reduceBlock: NULL version: @"1"];

in log it is printing all CBLView names. As mentioned setMapBlock is executed by aData CBLView, expecting that it executes only for AData CBLView instead of all CBLVIews

SravanPeddi avatar May 11 '22 10:05 SravanPeddi

Looks like you are using CBL iOS 1.x, and it's already kind of unsupported now. Is it possible to upgrade it to 3.x?

jayahariv avatar May 11 '22 13:05 jayahariv

is there any patch release available as we need to test all scenarios with upgradation.

SravanPeddi avatar May 11 '22 13:05 SravanPeddi

You can get the details of the releases from the documentation page https://docs.couchbase.com/couchbase-lite/current/index.html

Of course it will be a breaking API change.

jayahariv avatar May 11 '22 13:05 jayahariv

plz use the latest binary, if there is any issue with that let us know. Closing this

jayahariv avatar Sep 30 '22 09:09 jayahariv