Show / Hide Table of Contents

Class MutableDocument

A class representing an entry in a Couchbase Lite Database.
It consists of some metadata, and a collection of user-defined properties

Inheritance
System.Object
Document
MutableDocument
Implements
IJSON
System.IDisposable
IMutableDictionary
IDictionaryObject
IDictionaryFragment
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Object>>
System.Collections.IEnumerable
IMutableDictionaryFragment
Inherited Members
Document._dict
Document.Collection
Document.Id
Document.RevisionID
Document.Sequence
Document.Keys
Document.Count
Document.GetHashCode()
Document.Equals(Object)
Document.Contains(String)
Document.GetBlob(String)
Document.GetBoolean(String)
Document.GetDate(String)
Document.GetDouble(String)
Document.GetFloat(String)
Document.GetInt(String)
Document.GetLong(String)
Document.GetValue(String)
Document.GetString(String)
Document.ToDictionary()
Document.Dispose()
Document.IEnumerable.GetEnumerator()
Document.GetEnumerator()
Document.ToJSON()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
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 Source

MutableDocument()

Default Constructor

Declaration
public MutableDocument()
| Improve this Doc View Source

MutableDocument(IDictionary<String, Object>)

Creates a document with the given properties

Declaration
public MutableDocument(IDictionary<string, object> data)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<System.String, System.Object> data

The properties of the document

| Improve this Doc View Source

MutableDocument(String)

Creates a document given an ID

Declaration
public MutableDocument(string id)
Parameters
Type Name Description
System.String id

The ID for the document

| Improve this Doc View Source

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.String id

The ID for the document

System.Collections.Generic.IDictionary<System.String, System.Object> data

The properties for the document

| Improve this Doc View Source

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.String id

The ID for the document

System.String json

The json contains the properties for the document

Properties

| Improve this Doc View Source

Item[String]

Gets the value of the given key, or lack thereof, wrapped inside of a IMutableFragment

Declaration
public IMutableFragment this[string key] { get; }
Parameters
Type Name Description
System.String key

The key to check

Property Value
Type Description
IMutableFragment

The value of the given key, or lack thereof

Methods

| Improve this Doc View Source

GetArray(String)

Gets the value of a given key as an IMutableArray

Declaration
public MutableArrayObject GetArray(string key)
Parameters
Type Name Description
System.String key

The key to check the value for

Returns
Type Description
MutableArrayObject

The contained value, or null

| Improve this Doc View Source

GetDictionary(String)

Gets the value of a given key as a dictionary

Declaration
public MutableDictionaryObject GetDictionary(string key)
Parameters
Type Name Description
System.String key

The key to check the value for

Returns
Type Description
MutableDictionaryObject

The contained value, or null

| Improve this Doc View Source

Remove(String)

Removes the given key from this dictionary

Declaration
public IMutableDictionary Remove(string key)
Parameters
Type Name Description
System.String key

The key to remove

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

SetArray(String, ArrayObject)

Sets the given key to the given value

Declaration
public IMutableDictionary SetArray(string key, ArrayObject value)
Parameters
Type Name Description
System.String key

The key to set

ArrayObject value

The value to set

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

SetBlob(String, Blob)

Sets the given key to the given value

Declaration
public IMutableDictionary SetBlob(string key, Blob value)
Parameters
Type Name Description
System.String key

The key to set

Blob value

The value to set

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

SetBoolean(String, Boolean)

Sets the given key to the given value

Declaration
public IMutableDictionary SetBoolean(string key, bool value)
Parameters
Type Name Description
System.String key

The key to set

System.Boolean value

The value to set

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

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.Collections.Generic.IDictionary<System.String, System.Object> dictionary

The dictionary to replace the current contents with

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

SetDate(String, DateTimeOffset)

Sets the given key to the given value

Declaration
public IMutableDictionary SetDate(string key, DateTimeOffset value)
Parameters
Type Name Description
System.String key

The key to set

System.DateTimeOffset value

The value to set

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

SetDictionary(String, DictionaryObject)

Sets the given key to the given value

Declaration
public IMutableDictionary SetDictionary(string key, DictionaryObject value)
Parameters
Type Name Description
System.String key

The key to set

DictionaryObject value

The value to set

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

SetDouble(String, Double)

Sets the given key to the given value

Declaration
public IMutableDictionary SetDouble(string key, double value)
Parameters
Type Name Description
System.String key

The key to set

System.Double value

The value to set

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

SetFloat(String, Single)

Sets the given key to the given value

Declaration
public IMutableDictionary SetFloat(string key, float value)
Parameters
Type Name Description
System.String key

The key to set

System.Single value

The value to set

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

SetInt(String, Int32)

Sets the given key to the given value

Declaration
public IMutableDictionary SetInt(string key, int value)
Parameters
Type Name Description
System.String key

The key to set

System.Int32 value

The value to set

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

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.String json

The json string to replace the current contents with

Returns
Type Description
IMutableDictionary

Itself for further processing

Remarks

json string must be constructed from ToJSON

| Improve this Doc View Source

SetLong(String, Int64)

Sets the given key to the given value

Declaration
public IMutableDictionary SetLong(string key, long value)
Parameters
Type Name Description
System.String key

The key to set

System.Int64 value

The value to set

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

SetString(String, String)

Sets the given key to the given value

Declaration
public IMutableDictionary SetString(string key, string value)
Parameters
Type Name Description
System.String key

The key to set

System.String value

The value to set

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

SetValue(String, Object)

Sets the given key to the given value

Declaration
public IMutableDictionary SetValue(string key, object value)
Parameters
Type Name Description
System.String key

The key to set

System.Object value

The value to set

Returns
Type Description
IMutableDictionary

Itself for further processing

| Improve this Doc View Source

ToMutable()

Creates a mutable version of a document (i.e. one that can be edited)

Declaration
public override MutableDocument ToMutable()
Returns
Type Description
MutableDocument

A mutable version of the document

Overrides
Document.ToMutable()
Exceptions
Type Condition
System.InvalidOperationException

InvalidOperationException thrown when trying edit Documents from a replication filter.

| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
Document.ToString()

Implements

IJSON
System.IDisposable
IMutableDictionary
IDictionaryObject
IDictionaryFragment
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
IMutableDictionaryFragment

Extension Methods

DocumentExtensions.RevisionIDs(Document)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX