Click or drag to resize

DocumentUpdate Method

Creates and saves a new Revision by allowing the caller to update the existing properties. Conflicts are handled by calling the delegate again.

Namespace:  Couchbase.Lite
Assembly:  Couchbase.Lite (in Couchbase.Lite.dll) Version: 1.4.1-b107
Syntax
C#
public SavedRevision Update(
	DocumentUpdateDelegate updateDelegate
)

Parameters

updateDelegate
Type: Couchbase.LiteDocumentUpdateDelegate
The delegate that will be called to update the new Revision's properties. return YES, or just return NO to cancel.

Return Value

Type: SavedRevision
The new SavedRevision, or null on error or cancellation.
Exceptions
ExceptionCondition
CouchbaseLiteException Thrown if an error occurs while creating or saving the new Revision.
Remarks
Saves a new revision by letting the caller update the existing properties. This method handles conflicts by retrying (calling the block again). The DocumentUpdater implementation should modify the properties of the new revision and return YES to save or NO to cancel. Be careful: the DocumentUpdater can be called multiple times if there is a conflict!
See Also