Unsaved Revision

Unsaved Revision

extends Revision

An unsaved Couchbase Lite Document Revision.

Syntax


@interface CBLUnsavedRevision : CBLRevision
class CBLUnsavedRevision : CBLRevision
public class UnsavedRevision extends Revision
public class UnsavedRevision extends Revision
public class UnsavedRevision : Revision

Summary


Properties
boolean
isDeletion { get; set; }
Sets if the Revision marks the deletion of its Document.
Map<String, Object>
properties { get; set; }
Gets or sets the properties of the Revision.
Map<String, Object>
userProperties { get; set; }
Gets or sets the userProperties of the Revision. Get, returns the properties of the Revision without any properties with keys prefixed with '_' (which contain Couchbase Lite data). Set, replaces all properties except for those with keys prefixed with '_'.
Methods
void
removeAttachment(String name)
Removes the attachment with the given name. The Attachment will be deleted from the Database when the Revision is saved.
SavedRevision
save()
Saves the UnsavedRevision. This will fail if its parent is not the current Revision of the associated Document.
SavedRevision
save(boolean allowConflict)
Saves the UnsavedRevision, optionally allowing the save when there is a conflict.
void
setAttachment(String name, String contentType, Url contentUrl)
Sets the attachment with the given name. The Attachment data will be written to the Database when the Revision is saved.
void
setAttachment(String name, String contentType, byte[] content)
Sets the attachment with the given name. The Attachment data will be written to the Database when the Revision is saved.

Properties


boolean isDeletion { get; set; }
Sets if the Revision marks the deletion of its Document.

Syntax

@property (readwrite) BOOL isDeletion
var isDeletion: Bool
public boolean isDeletion()
public void setDeletion(boolean deletion)
public boolean isDeletion()
public void setDeletion(boolean deletion)
public Boolean IsDeletion { get; set; }
Map<String, Object> properties { get; set; }
Gets or sets the properties of the Revision.

Syntax

@property (readwrite) NSMutableDictionary * properties
var properties: [NSObject : AnyObject]!
public Map<String, Object> getProperties()
public void setProperties(Map<String, Object> properties)
public Map<String, Object> getProperties()
public void setProperties(Map<String, Object> properties)
public Dictionary<String, Object> Properties { get; set; }
Map<String, Object> userProperties { get; set; }
Gets or sets the userProperties of the Revision. Get, returns the properties of the Revision without any properties with keys prefixed with '_' (which contain Couchbase Lite data). Set, replaces all properties except for those with keys prefixed with '_'.

Syntax

@property (readwrite) NSMutableDictionary * userProperties
var userProperties: [NSObject : AnyObject]!
public Map<String, Object> getUserProperties()
public void setUserProperties(Map<String, Object> userProperties)
public Map<String, Object> getUserProperties()
public void setUserProperties(Map<String, Object> userProperties)
public Dictionary<String, Object> UserProperties { get; set; }

Methods


void removeAttachment(String name)
Removes the attachment with the given name. The Attachment will be deleted from the Database when the Revision is saved.

Parameters

name The name of the Attachment to delete.

Syntax

-(void)removeAttachmentNamed:(NSString *)name
func removeAttachmentNamed(name :String!)
public void removeAttachment(String name)
public void removeAttachment(String name)
public void RemoveAttachment(String name)
SavedRevision save()
Saves the UnsavedRevision. This will fail if its parent is not the current Revision of the associated Document.

Errors

Returns an error if an issue occurs while saving the UnsavedRevision.

Syntax

-(CBLSavedRevision *)save:(NSError **)outError
func save(outError: NSErrorPointer) -> CBLSavedRevision!
public SavedRevision save() throws CouchbaseLiteException
public SavedRevision save() throws CouchbaseLiteException
public SavedRevision Save()
SavedRevision save(boolean allowConflict)
Saves the UnsavedRevision, optionally allowing the save when there is a conflict.

Parameters

allowConflict Whether or not to allow saving when there is a conflict.

Errors

Returns an error if an issue occurs while saving the UnsavedRevision.

Syntax

-(CBLSavedRevision *)saveAllowingConflict:(NSError **)outError
func saveAllowingConflict(outError: NSErrorPointer) -> CBLSavedRevision!
public SavedRevision save(boolean allowConflict) throws CouchbaseLiteException
public SavedRevision save(boolean allowConflict) throws CouchbaseLiteException
public SavedRevision Save(Boolean allowConflict)
void setAttachment(String name, String contentType, Url contentUrl)
Sets the attachment with the given name. The Attachment data will be written to the Database when the Revision is saved.

Parameters

name The name of the Attachment to set.
contentType The content-type of the Attachment.
contentUrl The URL of the Attachment content.

Syntax

-(void)setAttachmentNamed:(NSString *)name withContentType:(NSString *)contentType contentUrl:(NSURL *)contentUrl
func setAttachmentNamed:(name: String!, withContentType: String!, contentURL: NSURL!)
public void setAttachment(String name, String contentType, URL contentUrl)
public void setAttachment(String name, String contentType, URL contentUrl)
public void SetAttachment(String name, String contentType, Uri contentUrl)
void setAttachment(String name, String contentType, byte[] content)
Sets the attachment with the given name. The Attachment data will be written to the Database when the Revision is saved.

Parameters

name The name of the Attachment to set.
contentType The content-type of the Attachment.
content The Attachment content.

Syntax

-(void)setAttachmentNamed:(NSString *)name withContentType:(NSString *)contentType content:(NSData *)content
func setAttachmentNamed(name: String!, withContentType: String!, content: NSData!)
public void setAttachment(String name, String contentType, Object content)
public void setAttachment(String name, String contentType, Object content)
public void SetAttachment(String name, String contentType, Object content)