Skip to content

Instantly share code, notes, and snippets.

@tomblench
Created April 6, 2018 10:23
Show Gist options
  • Save tomblench/e80581182d72deb148b60488bb47de73 to your computer and use it in GitHub Desktop.
Save tomblench/e80581182d72deb148b60488bb47de73 to your computer and use it in GitHub Desktop.
NSError *error;
CDTDatastoreManager *manager = [[CDTDatastoreManager alloc] initWithDirectory:@"/tmp" error:&error];
CDTDatastore *store = [manager datastoreNamed:@"my_ds" error:&error];
CDTDocumentRevision *rev = [CDTDocumentRevision revision];
rev.body = [@{ @"hello" : @"world" } mutableCopy];
[store createDocumentFromRevision:rev error:&error];
[store ensureIndexed:@[@"hello"]];
NSLog(@"Indexes: %@", [store listIndexes]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment