Reference documentation and code samples for the Cloud Datastore V1 Client class Query.
A query for entities.
The query stages are executed in the following order:
- kind
- filter
- projection
- order + start_cursor + end_cursor
- offset
- limit
- find_nearest
Generated from protobuf message google.datastore.v1.Query
Namespace
Google \ Cloud \ Datastore \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ projection
↳ kind
array< KindExpression
>
The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.
↳ filter
↳ order
↳ distinct_on
array< PropertyReference
>
The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned). Requires: * * If order
is specified, the set of distinct on properties must appear before the non-distinct on properties in order
.
↳ start_cursor
string
A starting point for the query results. Query cursors are returned in query result batches and can only be used to continue the same query .
↳ end_cursor
string
An ending point for the query results. Query cursors are returned in query result batches and can only be used to limit the same query .
↳ offset
int
The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.
↳ limit
Google\Protobuf\Int32Value
The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.
↳ find_nearest
FindNearest
Optional. A potential Nearest Neighbors Search. Applies after all other filters and ordering. Finds the closest vector embeddings to the given query vector.
getProjection
The projection to return. Defaults to returning all properties.
setProjection
The projection to return. Defaults to returning all properties.
$this
getKind
The kinds to query (if empty, returns entities of all kinds).
Currently at most 1 kind may be specified.
setKind
The kinds to query (if empty, returns entities of all kinds).
Currently at most 1 kind may be specified.
$this
getFilter
The filter to apply.
hasFilter
clearFilter
setFilter
The filter to apply.
$this
getOrder
The order to apply to the query results (if empty, order is unspecified).
setOrder
The order to apply to the query results (if empty, order is unspecified).
$this
getDistinctOn
The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).
Requires:
- If
order
is specified, the set of distinct on properties must appear before the non-distinct on properties inorder
.
setDistinctOn
The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).
Requires:
- If
order
is specified, the set of distinct on properties must appear before the non-distinct on properties inorder
.
$this
getStartCursor
A starting point for the query results. Query cursors are returned in query result batches and can only be used to continue the same query .
string
setStartCursor
A starting point for the query results. Query cursors are returned in query result batches and can only be used to continue the same query .
var
string
$this
getEndCursor
An ending point for the query results. Query cursors are returned in query result batches and can only be used to limit the same query .
string
setEndCursor
An ending point for the query results. Query cursors are returned in query result batches and can only be used to limit the same query .
var
string
$this
getOffset
The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.
int
setOffset
The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.
var
int
$this
getLimit
The maximum number of results to return. Applies after all other constraints. Optional.
Unspecified is interpreted as no limit. Must be >= 0 if specified.
hasLimit
clearLimit
getLimitValue
Returns the unboxed value from getLimit()
The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.
int|null
setLimit
The maximum number of results to return. Applies after all other constraints. Optional.
Unspecified is interpreted as no limit. Must be >= 0 if specified.
$this
setLimitValue
Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.
The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.
var
int|null
$this
getFindNearest
Optional. A potential Nearest Neighbors Search.
Applies after all other filters and ordering. Finds the closest vector embeddings to the given query vector.
hasFindNearest
clearFindNearest
setFindNearest
Optional. A potential Nearest Neighbors Search.
Applies after all other filters and ordering. Finds the closest vector embeddings to the given query vector.
$this