Is saving a CBLModel an expensive operation. How many seconds/milliseconds will it take to save a CBLModel to the database?
CBLModel *model = [database modelForDocument:documentID];
NSError *error;
[model save:&error];
Is saving a CBLModel an expensive operation. How many seconds/milliseconds will it take to save a CBLModel to the database?
CBLModel *model = [database modelForDocument:documentID];
NSError *error;
[model save:&error];
If you have many models to save, you may use CouchBaseLite transactions that greatly improve performance.
[database inTransaction:^BOOL()
{
for ( int i = 0; i < 1000; i++)
{
CBLModel *model = ...;
NSError *error;
[model save:&error];
}
return (YES);
}
];