Start a new topic

export Cache & KCSLinkedAppdataStore

I am trying to export query results to .json file but `[_store exportCache]` doesn't seem to work for KinveyRef objects.

In objectsornill I receive the related objects as entities while when doing exportCache all I get is references.



My store is a `KCSCachedStore` and is configured as `KCSLinkedAppdataStore` with options



_store = [KCSLinkedAppdataStore storeWithOptions:

@{

KCSStoreKeyCollectionName : @"Activity",

KCSStoreKeyCollectionTemplateClass : [ActionObj class],

KCSStoreKeyCachePolicy : @(KCSCachePolicyNetworkFirst),

KCSStoreKeyOfflineUpdateEnabled : @YES}];



Is is unsupported or am I doing something wrong?

Thanks

Export should just export the current collection. The reference values will be the KinveyRef dictionaries. If you need to also export the referenced collection, you'll have to create a store to do that too.
And how do I do that?
KCSCachedStore* store = [KCSCachedStore storeWithCollection:[KCSCollection collectionFromString:@"Reference" ofClass:[TheClass class]] options:nil];

NSArray* export = [store exportCache];

Login or Signup to post a comment