Cloud Firestore V1beta1 Client - Class StructuredQuery (1.53.0)

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 \ V1beta1

Methods

__construct

Constructor.

Parameters
Name
Description
data
array

Optional. Data for populating the Message object.

↳ select
StructuredQuery\Projection

The projection to return.

↳ from
array< StructuredQuery\CollectionSelector >

The collections to query.

↳ where
StructuredQuery\Filter

The filter to apply.

↳ 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
Cursor

A starting point for the query results.

↳ end_at
Cursor

A end point for the query results.

↳ 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.

Returns
Type
Description

setSelect

The projection to return.

Parameter
Name
Description
Returns
Type
Description
$this

getFrom

The collections to query.

Returns
Type
Description

setFrom

The collections to query.

Parameter
Name
Description
Returns
Type
Description
$this

getWhere

The filter to apply.

Returns
Type
Description

setWhere

The filter to apply.

Parameter
Name
Description
Returns
Type
Description
$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 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__
Returns
Type
Description

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 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__
Parameter
Name
Description
var
Returns
Type
Description
$this

getStartAt

A starting point for the query results.

Returns
Type
Description

setStartAt

A starting point for the query results.

Parameter
Name
Description
var
Returns
Type
Description
$this

getEndAt

A end point for the query results.

Returns
Type
Description

setEndAt

A end point for the query results.

Parameter
Name
Description
var
Returns
Type
Description
$this

getOffset

The number of results to skip.

Applies before limit, but after all other constraints. Must be >= 0 if specified.

Returns
Type
Description
int

setOffset

The number of results to skip.

Applies before limit, but after all other constraints. Must be >= 0 if specified.

Parameter
Name
Description
var
int
Returns
Type
Description
$this

getLimit

The maximum number of results to return.

Applies after all other constraints. Must be >= 0 if specified.

Returns
Type
Description

getLimitValue

Returns the unboxed value from getLimit()

The maximum number of results to return. Applies after all other constraints. Must be >= 0 if specified.

Returns
Type
Description
int|null

setLimit

The maximum number of results to return.

Applies after all other constraints. Must be >= 0 if specified.

Parameter
Name
Description
Returns
Type
Description
$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.

Parameter
Name
Description
var
int|null
Returns
Type
Description
$this
Design a Mobile Site
View Site in Mobile | Classic
Share by: