Click or drag to resize

LiveQuery Class

A Couchbase Lite ViewQuery that automatically refreshes every time the Database changes in a way that would affect the results.
Inheritance Hierarchy

Namespace:  Couchbase.Lite
Assembly:  Couchbase.Lite (in Couchbase.Lite.dll) Version: 1.4.1-b107
Syntax
C#
public sealed class LiveQuery : Query

The LiveQuery type exposes the following members.

Properties
  NameDescription
Public propertyAllDocsMode
Changes the behavior of a query created by -queryAllDocuments.
(Inherited from Query.)
Public propertyDatabase
Gets the Database that owns the Query's View.
(Inherited from Query.)
Public propertyDescending
Gets or sets whether the rows be returned in descending key order. Default value is false.
(Inherited from Query.)
Public propertyEndKey
Gets or sets the key of the last value to return. A null value has no effect.
(Inherited from Query.)
Public propertyEndKeyDocId
Gets or sets the Document id of the last value to return. A null value has no effect. This is useful if the view contains multiple identical keys, making endKey ambiguous.
(Inherited from Query.)
Public propertyGroupLevel
Gets or sets whether results will be grouped in Views that have reduce functions.
(Inherited from Query.)
Public propertyIncludeDeleted Obsolete.
Gets or sets whether Queries created via the Database createAllDocumentsQuery method will include deleted Documents. This property has no effect in other types of Queries.
(Inherited from Query.)
Public propertyInclusiveEnd
If true the EndKey (or EndKeyDocID) comparison uses "<=". Else it uses "<". Default value is true.
(Inherited from Query.)
Public propertyInclusiveStart
If true the StartKey (or StartKeyDocID) comparison uses ">=". Else it uses ">"
(Inherited from Query.)
Public propertyIndexUpdateMode
Gets or sets when a View index is updated when running a Query.
(Inherited from Query.)
Public propertyKeys
Gets or sets the keys of the values to return. A null value has no effect.
(Inherited from Query.)
Public propertyLastError
Returns the last error, if any, that occured while executing the Query, otherwise null.
Public propertyLimit
Gets or sets the maximum number of rows to return. The default value is int.MaxValue, meaning 'unlimited'.
(Inherited from Query.)
Public propertyMapOnly
Gets or sets whether to only use the map function without using the reduce function.
(Inherited from Query.)
Public propertyPostFilter
Gets or sets an optional predicate that filters the resulting query rows. If present, it's called on every row returned from the query, and if it returnsfalseNO the row is skipped.
(Inherited from Query.)
Public propertyPrefetch
Gets or sets whether to include the entire Document content with the results. The Documents can be accessed via the QueryRow's documentProperties property.
(Inherited from Query.)
Public propertyPrefixMatchLevel
If nonzero, enables prefix matching of string or array keys. * A value of 1 treats the endKey itself as a prefix: if it's a string, keys in the index that come after the endKey, but begin with the same prefix, will be matched. (For example, if the endKey is "foo" then the key "foolish" in the index will be matched, but not "fong".) Or if the endKey is an array, any array beginning with those elements will be matched. (For example, if the endKey is [1], then [1, "x"] will match, but not [2].) If the key is any other type, there is no effect. * A value of 2 assumes the endKey is an array and treats its final item as a prefix, using the rules above. (For example, an endKey of [1, "x"] will match [1, "xtc"] but not [1, "y"].) * A value of 3 assumes the key is an array of arrays, etc. Note that if the .descending property is also set, the search order is reversed and the above discussion applies to the startKey, _not_ the endKey.
(Inherited from Query.)
Public propertyRows
Gets the results of the Query. The value will be null until the initial Query completes.
Public propertySkip
Gets or sets the number of initial rows to skip. Default value is 0.
(Inherited from Query.)
Public propertyStartKey
Gets or sets the key of the first value to return. A null value has no effect.
(Inherited from Query.)
Public propertyStartKeyDocId
Gets or sets the Document id of the first value to return. A null value has no effect. This is useful if the view contains multiple identical keys, making startKey ambiguous.
(Inherited from Query.)
Public propertyUpdateInterval
The shortest interval at which the query will update, regardless of how often the database changes. Defaults to 200ms. Increase this if the query is expensive and the database updates frequently, to limit CPU consumption.
Top
Methods
  NameDescription
Public methodDispose
Releases all resource used by the Query object.
(Inherited from Query.)
Public methodQueryOptionsChanged
Used to indicate that the options of the live query have changed since its first run.
Public methodRun
Sends the query to the server and returns an enumerator over the result rows (Synchronous).
(Overrides QueryRun.)
Public methodRunAsync
Runs the Query asynchronously and will notified Completed event handlers on completion.
(Inherited from Query.)
Public methodRunAsync(FuncQueryEnumerator, CancellationToken)
Runs Query function asynchronously and will notified Completed event handlers on completion.
(Inherited from Query.)
Public methodStart
Starts observing database changes.
Public methodStop
Stops the LiveQuery and stops observing Database changes.
Public methodToLiveQuery
Returns a new LiveQuery with identical properties to the the Query.
(Inherited from Query.)
Public methodToString (Overrides QueryToString.)
Public methodWaitForRows
Blocks until the intial Query completes.
Top
Events
  NameDescription
Public eventChanged
Adds or removed a LiveQuery change delegate that will be called whenever the Database changes in a way that would affect the results of the Query.
Public eventCompleted
Event raised when a query has finished running.
(Inherited from Query.)
Top
See Also