Classes

The following classes are available globally.

  • A Couchbase Lite database.

    See more

    Declaration

    Swift

    public final class Database
    extension Database : QueryFactory
  • ENTERPRISE EDITION ONLY.

    Certificate Authenticator for the URLEndpointListener.

    See more

    Declaration

    Swift

    @available(macOS 10.12, iOS 10.0, *)
    public class ListenerCertificateAuthenticator : _ListenerAuthenticator
  • ENTERPRISE EDITION ONLY.

    Password Authenticator for the URLEndpointListener.

    See more

    Declaration

    Swift

    @available(macOS 10.12, iOS 10.0, *)
    public class ListenerPasswordAuthenticator : _ListenerAuthenticator
  • ENTERPRISE EDITION ONLY.

    TLSIdentity provides TLS Identity information including a key pair and X.509 certificate chain used for configuring TLS communication to the listener.

    See more

    Declaration

    Swift

    @available(macOS 10.12, iOS 10.0, *)
    public class TLSIdentity
  • ENTERPRISE EDITION ONLY.

    A listener to provide websocket based endpoint for peer-to-peer replication. Once the listener is started, peer replicators can connect to the listener by using URLEndpoint

    See more

    Declaration

    Swift

    @available(macOS 10.12, iOS 10.0, *)
    public class URLEndpointListener
  • ENTERPRISE EDITION ONLY

    CoreMLPredictiveModel is a Core ML based implementation of the PredictiveModel protocol. Basically the CoreMLPredictiveModel used a Core ML model to return prediction results.

    CoreMLPredictiveModel automatically converts between Couchbase Lite data and Core ML data when calling into the MLModel object to return prediction results. All Core ML data types including Int64, Double, String, Dictionary, MultiArray, Image, and Sequence are supported.

    When the MLObject has a single input and the input type is Image, CoreMLPredictiveModel will use Vision framework via the VNCoreMLModel to process the input image and call into the MLModel object. The CoreMLPredictiveModel supports all VNObservation types including VNClassificationObservation, VNCoreMLFeatureValueObservation, and VNPixelBufferObservation as mentioned in https://developer.apple.com/documentation/vision/vncoremlrequest. However there is a compatibility limitation when the VNCoreMLModel returns VNCoreMLFeatureValueObservation or VNPixelBufferObservation results that the MLModel must return a single output, otherwise the observation outputs cannot be mapped to the MLModel outputs. When the VNCoreMLModel cannot be used to result the prediction result, CoreMLPredictiveModel will fall back to use the MLModel instead.

    When converting blob data to VNPixelBuffer for an input image, only ARGB pixel format is currently supported. However this limitation is applied only when the VNCoreMLModel cannot be used.

    See more

    Declaration

    Swift

    @available(macOS 10.13, iOS 11.0, *)
    open class CoreMLPredictiveModel : PredictiveModel
  • Function factory.

    See more

    Declaration

    Swift

    public final class Function
  • IndexBuilder used for building database index objects.

    See more

    Declaration

    Swift

    public class IndexBuilder
  • ENTERPRISE EDITION ONLY

    Predictive model manager class for registering and unregistering predictive models.

    See more

    Declaration

    Swift

    public class Prediction
  • ENTERPRISE EDITION ONLY

    The predictive index used for querying with prediction function. The predictive index is different from the normal index in that the predictive index will cache the prediction result along with creating the value index of the prediction output properties.

    The PredictiveIndex can be created by using IndexBuilder’s predictiveIndex() function. If the prediction output properties are not specified, the predictive index will only cache the predictive result so that the predictive model will not be called again after indexing.

    Declaration

    Swift

    public final class PredictiveIndex : Index, CBLIndexConvertible
  • ENTERPRISE EDITION ONLY.

    A message sent between message endpoint connections.

    See more

    Declaration

    Swift

    public final class Message
  • ENTERPRISE EDITION ONLY.

    Message endpoint.

    See more

    Declaration

    Swift

    public class MessageEndpoint : IEndpoint
  • ENTERPRISE EDITION ONLY.

    Configuration for MessageEndpointListener

    See more

    Declaration

    Swift

    public class MessageEndpointListenerConfiguration
  • ENTERPRISE EDITION ONLY.

    The listener for incoming message endpoint connections.

    See more

    Declaration

    Swift

    public class MessageEndpointListener
  • Array expression.

    See more

    Declaration

    Swift

    public final class ArrayExpression
  • The In class represents the IN clause object in a quantified operator (ANY/ANY AND EVERY/EVERY IN SATISFIES ). The IN clause is used for specifying an array object or an expression evaluated as an array object, each item of which will be evaluated against the satisfies expression.

    See more

    Declaration

    Swift

    public final class ArrayExpressionIn
  • The Satisfies class represents the SATISFIES clause object in a quantified operator (ANY/ANY AND EVERY/EVERY IN SATISFIES ). The SATISFIES clause is used for specifying an expression that will be used to evaluate each item in the array.

    See more

    Declaration

    Swift

    public final class ArrayExpressionSatisfies
  • Array function factory.

    See more

    Declaration

    Swift

    public final class ArrayFunction
  • ArrayObject provides readonly access to array data.

    See more

    Declaration

    Swift

    public class ArrayObject : ArrayProtocol, Equatable, Hashable, Sequence
  • Blob contains arbitrary binary data, tagged with a MIME type. Blobs can be arbitrarily large, and their data is loaded only on demand (when the content or contentStream properties are accessed), not when the document is loaded. The document’s raw JSON form only contains the Blob’s metadata (type, length and a digest of the data) in a small object. The data itself is stored externally to the document, keyed by the digest.

    See more

    Declaration

    Swift

    public final class Blob : Equatable, Hashable
  • Collation factory. CouchbaseLite provides two types of the Collation, ASCII and Unicode. Without specifying the COLLATE expression. Couchbase Lite will use the ASCII with case sensitive collation by default.

    See more

    Declaration

    Swift

    public final class Collation
  • A Collection represent a collection which is a container for documents.

    A collection can be thought as a table in the relational database. Each collection belongs to a scope which is simply a namespce, and has a name which is unique within its scope.

    When a new database is created, a default collection named _default will be automatically created. The default collection is created under the default scope named _default. The name of the default collection and scope can be referenced by using Collection.defaultCollectionName and Scope.defaultScopeName constant.

    Note

    The default collection cannot be deleted.

    When creating a new collection, the collection name, and the scope name are required. The naming rules of the collections and scopes are as follows:

    • Must be between 1 and 251 characters in length.
    • Can only contain the characters A-Z, a-z, 0-9, and the symbols _, -, and %.
    • Cannot start with _ or %.
    • Both scope and collection names are case sensitive.

    Collection Lifespan

    A Collection object and its reference remain valid until either the database is closed or the collection itself is deleted, in that case it will throw an NSError with the CBLError.notOpen code while accessing the collection APIs.

    Legacy Database and API

    When using the legacy database, the existing documents and indexes in the database will be automatically migrated to the default collection.

    Any pre-existing database functions that refer to documents, listeners, and indexes without specifying a collection such as database.document(id:) will implicitly operate on the default collection. In other words, they behave exactly the way they used to, but collection-aware code should avoid them and use the new Collection API instead. These legacy functions are deprecated and will be removed eventually.

    See more

    Declaration

    Swift

    public final class Collection : CollectionChangeObservable, Indexable, Equatable, Hashable
  • ConflictResolver provides access to the default conflict resolver used by the replicator

    See more

    Declaration

    Swift

    public final class ConflictResolver
  • Undocumented

    See more

    Declaration

    Swift

    public class ConsoleLogger
  • A query data source factory. The current data source supported is the database.

    See more

    Declaration

    Swift

    public final class DataSource
  • Log file configuration.

    See more

    Declaration

    Swift

    public class LogFileConfiguration
  • Undocumented

    See more

    Declaration

    Swift

    public class FullTextIndexConfiguration : IndexConfiguration, IndexConfigConvertable
  • DictionaryObject provides readonly access to dictionary data.

    See more

    Declaration

    Swift

    public class DictionaryObject : DictionaryProtocol, Equatable, Hashable, Sequence
  • Couchbase Lite document. The Document is immutable.

    See more

    Declaration

    Swift

    public class Document : DictionaryProtocol, Equatable, Hashable, Sequence
  • DocumentFragment provides access to a document object. DocumentFragment also provides subscript access by either key or index to the data values of the document which are wrapped by Fragment objects.

    See more

    Declaration

    Swift

    public final class DocumentFragment : DictionaryFragment
  • Query expression factory.

    See more

    Declaration

    Swift

    public final class Expression
  • File logger used for writing log messages to files. To enable the file logger, setup the log file configuration and specify the log level as desired.

    It is important to configure your LogFileConfiguration object appropriately before setting to a logger. Logger make a copy of the configuration settings you provide and use those settings to configure the logger. Once configured, the logger object ignores any changes you make to the LogFileConfiguration object.

    See more

    Declaration

    Swift

    public class FileLogger
  • Fragment provides readonly access to data value. Fragment also provides subscript access by either key or index to the nested values which are wrapped by Fragment objects.

    See more

    Declaration

    Swift

    public class Fragment : FragmentProtocol, ArrayFragment, DictionaryFragment
  • A From component representing a FROM clause for specifying the data source of the query.

    See more

    Declaration

    Swift

    public final class From : Query, JoinRouter, WhereRouter, GroupByRouter, OrderByRouter, LimitRouter
  • Full-text expression factory.

    See more

    Declaration

    Swift

    @available(*, deprecated, message: "Use FullTextFunction.match(indexName: String, query: String﹚ instead.")
    public final class FullTextExpression
  • Full-text function factory.

    See more

    Declaration

    Swift

    public final class FullTextFunction
  • A GroupBy represents the GROUP BY clause to group the query result. The GROUP BY clause is normally used with aggregate functions (AVG, COUNT, MAX, MIN, SUM) to aggregate the group of the values.

    See more

    Declaration

    Swift

    public final class GroupBy : Query, HavingRouter, OrderByRouter, LimitRouter
  • Having represents a HAVING clause of the query statement used for filtering the aggregated values from the the GROUP BY clause.

    See more

    Declaration

    Swift

    public final class Having : Query, OrderByRouter, LimitRouter

Value Index

  • A value index for regular queries.

    Declaration

    Swift

    public final class ValueIndex : Index, CBLIndexConvertible
  • Value Index Item.

    See more

    Declaration

    Swift

    public final class ValueIndexItem

FTS Index

  • A full-text search index for full-text search query with the match operator.

    See more

    Declaration

    Swift

    public final class FullTextIndex : Index, CBLIndexConvertible
  • Full-text search index item.

    See more

    Declaration

    Swift

    public class FullTextIndexItem
  • Undocumented

    See more

    Declaration

    Swift

    public class ValueIndexConfiguration : IndexConfiguration, IndexConfigConvertable
  • Join factory.

    See more

    Declaration

    Swift

    public class Join
  • A Joins component represents a collection of the joins clauses of the query statement.

    See more

    Declaration

    Swift

    public final class Joins : Query, WhereRouter, OrderByRouter, LimitRouter
  • A Limit component represents the LIMIT clause of the query statement.

    Declaration

    Swift

    public final class Limit : Query
  • Listener token returned when adding a change listener. The token is used for removing the added change listener.

    See more

    Declaration

    Swift

    public class ListenerToken
  • Log

    Log allows to configure console and file logger or to set a custom logger.

    See more

    Declaration

    Swift

    public class Log
  • Meta is a factory class for creating the meta expressions that refer to the metadata properties of the document.

    See more

    Declaration

    Swift

    public final class Meta
  • MutableArrayObject provides access to array data.

    See more

    Declaration

    Swift

    public final class MutableArrayObject : ArrayObject, MutableArrayProtocol
  • MutableDictionaryObject provides access to dictionary data.

    See more

    Declaration

    Swift

    public final class MutableDictionaryObject : DictionaryObject, MutableDictionaryProtocol
  • A mutable version of the Document.

    See more

    Declaration

    Swift

    public final class MutableDocument : Document, MutableDictionaryProtocol
  • MutableFragment provides read and write access to data value. MutableFragment also provides subscript access by either key or index to the nested values which are wrapped by MutableFragment objects.

    See more

    Declaration

    Swift

    public final class MutableFragment : Fragment, MutableDictionaryFragment, MutableArrayFragment
  • An OrderBy represents an ORDER BY clause of the query statement.

    See more

    Declaration

    Swift

    public final class OrderBy : Query, LimitRouter
  • Ordering factory.

    See more

    Declaration

    Swift

    public final class Ordering
  • Query parameters used for setting values to the query parameters defined in the query.

    See more

    Declaration

    Swift

    public class Parameters
  • A database query. A Query instance can be constructed by calling one of the select class methods.

    See more

    Declaration

    Swift

    public class Query
    extension Query: CustomStringConvertible
  • A factory class to create a Select instance.

    See more

    Declaration

    Swift

    public final class QueryBuilder
  • A replicator for replicating document changes between a local database and a target database. The replicator can be bidirectional or either push or pull. The replicator can also be one-short or continuous. The replicator runs asynchronously, so observe the status property to be notified of progress.

    See more

    Declaration

    Swift

    public final class Replicator
  • Result represents a single row in the query result. The projecting result value can be accessed either by using a zero based index or by a key corresponding to the SelectResult objects given when constructing the Query object.

    A key used for accessing the projecting result value could be one of the followings:

    • The alias name of the SelectResult object.
    • The last component of the keypath or property name of the property expression used when creating the SelectResult object.
    • The provision key in $1, $2, …$N format for the SelectResult that doesn’t have an alias name specified or is not a property expression such as an aggregate function expression (e.g. count(), avg(), min(), max(), sum() and etc). The number suffix after the ‘$’ character is a running number starting from one.
    See more

    Declaration

    Swift

    public final class Result : ArrayProtocol, DictionaryProtocol, Sequence
  • ResultSet is a result returned from a query.

    See more

    Declaration

    Swift

    public final class ResultSet : Sequence, IteratorProtocol
  • A Scope represents a scope or namespace of the collections.

    The scope implicitly exists when there is at least one collection created under the scope. The default scope is exceptional in that it will always exists even there are no collections under it.

    Scope Lifespan A Scope object remain valid until either the database is closed or the scope itself is invalidated as all collections in the scope have been deleted.

    See more

    Declaration

    Swift

    public final class Scope
  • A Select component represents the returning properties in each query result row.

    See more

    Declaration

    Swift

    public final class Select : Query, FromRouter
  • SelectResult factory.

    See more

    Declaration

    Swift

    public final class SelectResult
  • Where class represents the WHERE clause of the query statement.

    See more

    Declaration

    Swift

    public final class Where : Query, GroupByRouter, OrderByRouter, LimitRouter