Class MutableDocument
A class representing an entry in a Couchbase Lite Database.
It consists of some metadata, and a collection of user-defined properties
Implements
Inherited Members
Namespace: Couchbase.Lite
Assembly: Couchbase.Lite.dll
Syntax
public sealed class MutableDocument : Document, IJSON, IDisposable, IMutableDictionary, IDictionaryObject, IDictionaryFragment, IEnumerable<KeyValuePair<string, object>>, IEnumerable, IMutableDictionaryFragment
Constructors
| Improve this Doc View SourceMutableDocument()
Default Constructor
Declaration
public MutableDocument()
MutableDocument(IDictionary<String, Object>)
Creates a document with the given properties
Declaration
public MutableDocument(IDictionary<string, object> data)
Parameters
Type | Name | Description |
---|---|---|
System. |
data | The properties of the document |
MutableDocument(String)
Creates a document given an ID
Declaration
public MutableDocument(string id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The ID for the document |
MutableDocument(String, IDictionary<String, Object>)
Creates a document with the given ID and properties
Declaration
public MutableDocument(string id, IDictionary<string, object> data)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The ID for the document |
System. |
data | The properties for the document |
MutableDocument(String, String)
Creates a document with the given ID and json string
Declaration
public MutableDocument(string id, string json)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The ID for the document |
System. |
json | The json contains the properties for the document |
Properties
| Improve this Doc View SourceItem[String]
Gets the value of the given key, or lack thereof,
wrapped inside of a IMutable
Declaration
public IMutableFragment this[string key] { get; }
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to check |
Property Value
Type | Description |
---|---|
IMutable |
The value of the given key, or lack thereof |
Methods
| Improve this Doc View SourceGetArray(String)
Gets the value of a given key as an IMutable
Declaration
public MutableArrayObject GetArray(string key)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to check the value for |
Returns
Type | Description |
---|---|
Mutable |
The contained value, or |
GetDictionary(String)
Gets the value of a given key as a dictionary
Declaration
public MutableDictionaryObject GetDictionary(string key)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to check the value for |
Returns
Type | Description |
---|---|
Mutable |
The contained value, or |
Remove(String)
Removes the given key from this dictionary
Declaration
public IMutableDictionary Remove(string key)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to remove |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
SetArray(String, ArrayObject)
Sets the given key to the given value
Declaration
public IMutableDictionary SetArray(string key, ArrayObject value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to set |
Array |
value | The value to set |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
SetBlob(String, Blob)
Sets the given key to the given value
Declaration
public IMutableDictionary SetBlob(string key, Blob value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to set |
Blob | value | The value to set |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
SetBoolean(String, Boolean)
Sets the given key to the given value
Declaration
public IMutableDictionary SetBoolean(string key, bool value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to set |
System. |
value | The value to set |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
SetData(IDictionary<String, Object>)
Replaces the contents of this dictionary with the contents of the given one
Declaration
public IMutableDictionary SetData(IDictionary<string, object> dictionary)
Parameters
Type | Name | Description |
---|---|---|
System. |
dictionary | The dictionary to replace the current contents with |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
SetDate(String, DateTimeOffset)
Sets the given key to the given value
Declaration
public IMutableDictionary SetDate(string key, DateTimeOffset value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to set |
System. |
value | The value to set |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
SetDictionary(String, DictionaryObject)
Sets the given key to the given value
Declaration
public IMutableDictionary SetDictionary(string key, DictionaryObject value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to set |
Dictionary |
value | The value to set |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
SetDouble(String, Double)
Sets the given key to the given value
Declaration
public IMutableDictionary SetDouble(string key, double value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to set |
System. |
value | The value to set |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
SetFloat(String, Single)
Sets the given key to the given value
Declaration
public IMutableDictionary SetFloat(string key, float value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to set |
System. |
value | The value to set |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
SetInt(String, Int32)
Sets the given key to the given value
Declaration
public IMutableDictionary SetInt(string key, int value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to set |
System. |
value | The value to set |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
SetJSON(String)
Replaces the contents of this dictionary with the contents of the given json string
Declaration
public IMutableDictionary SetJSON(string json)
Parameters
Type | Name | Description |
---|---|---|
System. |
json | The json string to replace the current contents with |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
Remarks
json string must be constructed from To
SetLong(String, Int64)
Sets the given key to the given value
Declaration
public IMutableDictionary SetLong(string key, long value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to set |
System. |
value | The value to set |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
SetString(String, String)
Sets the given key to the given value
Declaration
public IMutableDictionary SetString(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to set |
System. |
value | The value to set |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
SetValue(String, Object)
Sets the given key to the given value
Declaration
public IMutableDictionary SetValue(string key, object value)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key to set |
System. |
value | The value to set |
Returns
Type | Description |
---|---|
IMutable |
Itself for further processing |
ToMutable()
Creates a mutable version of a document (i.e. one that can be edited)
Declaration
public override MutableDocument ToMutable()
Returns
Type | Description |
---|---|
Mutable |
A mutable version of the document |
Overrides
Exceptions
Type | Condition |
---|---|
System. |
InvalidOperationException thrown when trying edit Documents from a replication filter. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System. |