Reference documentation and code samples for the Cloud Firestore V1beta1 Client class StructuredQuery.
A Firestore query.
Generated from protobuf message google.firestore.v1beta1.StructuredQuery
Namespace
Google \ Cloud \ Firestore \ V1beta1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ select
↳ from
↳ where
↳ order_by
array< StructuredQuery\Order
>
The order to apply to the query results. Firestore guarantees a stable ordering through the following rules: * * Any field required to appear in order_by
, that is not already specified in order_by
, is appended to the order in field name order by default. * * If an order on __name__
is not specified, it is appended by default. Fields are appended with the same sort direction as the last order specified, or 'ASCENDING' if no order was specified. For example: * * SELECT * FROM Foo ORDER BY A
becomes SELECT * FROM Foo ORDER BY A, __name__
* * SELECT * FROM Foo ORDER BY A DESC
becomes SELECT * FROM Foo ORDER BY A DESC, __name__ DESC
* * SELECT * FROM Foo WHERE A > 1
becomes SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__
↳ start_at
↳ end_at
↳ offset
int
The number of results to skip. Applies before limit, but after all other constraints. Must be >= 0 if specified.
↳ limit
Google\Protobuf\Int32Value
The maximum number of results to return. Applies after all other constraints. Must be >= 0 if specified.
getSelect
The projection to return.
setSelect
The projection to return.
$this
getFrom
The collections to query.
setFrom
The collections to query.
$this
getWhere
The filter to apply.
setWhere
The filter to apply.
$this
getOrderBy
The order to apply to the query results.
Firestore guarantees a stable ordering through the following rules:
- Any field required to appear in
order_by
, that is not already specified inorder_by
, is appended to the order in field name order by default. - If an order on
__name__
is not specified, it is appended by default. Fields are appended with the same sort direction as the last order specified, or 'ASCENDING' if no order was specified. For example: -
SELECT * FROM Foo ORDER BY A
becomesSELECT * FROM Foo ORDER BY A, __name__
-
SELECT * FROM Foo ORDER BY A DESC
becomesSELECT * FROM Foo ORDER BY A DESC, __name__ DESC
-
SELECT * FROM Foo WHERE A > 1
becomesSELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__
setOrderBy
The order to apply to the query results.
Firestore guarantees a stable ordering through the following rules:
- Any field required to appear in
order_by
, that is not already specified inorder_by
, is appended to the order in field name order by default. - If an order on
__name__
is not specified, it is appended by default. Fields are appended with the same sort direction as the last order specified, or 'ASCENDING' if no order was specified. For example: -
SELECT * FROM Foo ORDER BY A
becomesSELECT * FROM Foo ORDER BY A, __name__
-
SELECT * FROM Foo ORDER BY A DESC
becomesSELECT * FROM Foo ORDER BY A DESC, __name__ DESC
-
SELECT * FROM Foo WHERE A > 1
becomesSELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__
$this
getStartAt
A starting point for the query results.
setStartAt
A starting point for the query results.
$this
getEndAt
A end point for the query results.
setEndAt
A end point for the query results.
$this
getOffset
The number of results to skip.
Applies before limit, but after all other constraints. Must be >= 0 if specified.
int
setOffset
The number of results to skip.
Applies before limit, but after all other constraints. Must be >= 0 if specified.
var
int
$this
getLimit
The maximum number of results to return.
Applies after all other constraints. Must be >= 0 if specified.
getLimitValue
Returns the unboxed value from getLimit()
The maximum number of results to return. Applies after all other constraints. Must be >= 0 if specified.
int|null
setLimit
The maximum number of results to return.
Applies after all other constraints. 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. Must be >= 0 if specified.
var
int|null
$this