Click or drag to resize

Query Class

A Couchbase Lite ViewQuery.
Inheritance Hierarchy

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

The Query type exposes the following members.

Properties
  NameDescription
Public propertyAllDocsMode
Changes the behavior of a query created by -queryAllDocuments.
Public propertyDatabase
Gets the Database that owns the Query's View.
Public propertyDescending
Gets or sets whether the rows be returned in descending key order. Default value is false.
Public propertyEndKey
Gets or sets the key of the last value to return. A null value has no effect.
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.
Public propertyGroupLevel
Gets or sets whether results will be grouped in Views that have reduce functions.
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.
Public propertyInclusiveEnd
If true the EndKey (or EndKeyDocID) comparison uses "<=". Else it uses "<". Default value is true.
Public propertyInclusiveStart
If true the StartKey (or StartKeyDocID) comparison uses ">=". Else it uses ">"
Public propertyIndexUpdateMode
Gets or sets when a View index is updated when running a Query.
Public propertyKeys
Gets or sets the keys of the values to return. A null value has no effect.
Public propertyLimit
Gets or sets the maximum number of rows to return. The default value is int.MaxValue, meaning 'unlimited'.
Public propertyMapOnly
Gets or sets whether to only use the map function without using the reduce function.
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.
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.
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.
Public propertySkip
Gets or sets the number of initial rows to skip. Default value is 0.
Public propertyStartKey
Gets or sets the key of the first value to return. A null value has no effect.
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.
Top
Methods
  NameDescription
Public methodDispose
Releases all resource used by the Query object.
Public methodRun
Runs the Query and returns an enumerator over the result rows.
Public methodRunAsync
Runs the Query asynchronously and will notified Completed event handlers on completion.
Public methodRunAsync(FuncQueryEnumerator, CancellationToken)
Runs Query function asynchronously and will notified Completed event handlers on completion.
Public methodToLiveQuery
Returns a new LiveQuery with identical properties to the the Query.
Public methodToString (Overrides ObjectToString.)
Top
Events
  NameDescription
Public eventCompleted
Event raised when a query has finished running.
Top
See Also