Click or drag to resize

Database Class

A container for storing and maintaining Couchbase Lite Documents
Inheritance Hierarchy
SystemObject
  Couchbase.LiteDatabase

Namespace:  Couchbase.Lite
Assembly:  Couchbase.Lite (in Couchbase.Lite.dll) Version: 2.0.0-b0520
Syntax
C#
public sealed class Database : IDisposable

The Database type exposes the following members.

Constructors
  NameDescription
Public methodDatabase
Creates a database given a name and some configuration
Top
Properties
  NameDescription
Public propertyConfig
Gets the configuration that were used to create the database
Public propertyCount
Gets the total number of documents in the database
Public propertyItem
Bracket operator for retrieving DocumentFragment objects
Public propertyName
Gets the name of the database
Public propertyPath
Gets the path on disk where the database exists
Top
Methods
  NameDescription
Public methodAddChangeListener(EventHandlerDatabaseChangedEventArgs)
Adds a change listener for the changes that occur in this database. Signatures are the same as += style event handlers.
Public methodAddChangeListener(TaskScheduler, EventHandlerDatabaseChangedEventArgs)
Adds a change listener for the changes that occur in this database. Signatures are the same as += style event handlers, but this signature allows the use of a custom task scheduler, if desired.
Public methodAddDocumentChangeListener(String, EventHandlerDocumentChangedEventArgs)
Adds a listener for changes on a certain document (by ID).
Public methodAddDocumentChangeListener(String, TaskScheduler, EventHandlerDocumentChangedEventArgs)
Adds a listener for changes on a certain document (by ID).
Public methodClose
Closes the database
Public methodCompact
Performs a manual compaction of this database, removing old irrelevant data and decreasing the size of the database file on disk
Public methodStatic memberCopy
Copies a database from the given path to be used as the database with the given name and configuration
Public methodCreateIndex
Creates an index of the given type on the given path with the given configuration
Public methodDelete
Deletes the database
Public methodDelete(Document)
Deletes the given Document from the database
Public methodStatic memberDelete(String, String)
Deletes the contents of a database with the given name in the given directory
Public methodDeleteIndex
Deletes the index with the given name
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Overrides ObjectEquals(Object).)
Public methodStatic memberExists
Returns whether or not a database with the given name exists in the given directory
Protected methodFinalize
Finalizer
(Overrides ObjectFinalize.)
Public methodGetDocument
Gets the Document with the specified ID
Public methodGetHashCode
Serves as the default hash function.
(Overrides ObjectGetHashCode.)
Public methodGetIndexes
Gets a list of index names that are present in the database
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInBatch
Runs the given batch of operations as an atomic unit
Public methodPurge
Purges the given Document from the database. This leaves no trace behind and will not be replicated
Public methodRemoveChangeListener
Removes a database changed listener by token
Public methodSave
Saves the given MutableDocument into this database
Public methodSetEncryptionKey
Sets the encryption key for the database. If null, encryption is removed.
Public methodStatic memberSetLogLevel
Sets the log level for the given domains(s)
Public methodToString
Returns a string that represents the current object.
(Overrides ObjectToString.)
Top
See Also