Cloud Firestore V1beta1 Client - Class StructuredQuery (1.36.1)

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
NameDescription
data array

Optional. Data for populating the Message object.

↳ select Google\Cloud\Firestore\V1beta1\StructuredQuery\Projection

The projection to return.

↳ from array<Google\Cloud\Firestore\V1beta1\StructuredQuery\CollectionSelector>

The collections to query.

↳ where Google\Cloud\Firestore\V1beta1\StructuredQuery\Filter

The filter to apply.

↳ order_by array<Google\Cloud\Firestore\V1beta1\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 Google\Cloud\Firestore\V1beta1\Cursor

A starting point for the query results.

↳ end_at Google\Cloud\Firestore\V1beta1\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
TypeDescription
Google\Cloud\Firestore\V1beta1\StructuredQuery\Projection

setSelect

The projection to return.

Parameter
NameDescription
var Google\Cloud\Firestore\V1beta1\StructuredQuery\Projection
Returns
TypeDescription
$this

getFrom

The collections to query.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setFrom

The collections to query.

Parameter
NameDescription
var array<Google\Cloud\Firestore\V1beta1\StructuredQuery\CollectionSelector>
Returns
TypeDescription
$this

getWhere

The filter to apply.

Returns
TypeDescription
Google\Cloud\Firestore\V1beta1\StructuredQuery\Filter

setWhere

The filter to apply.

Parameter
NameDescription
var Google\Cloud\Firestore\V1beta1\StructuredQuery\Filter
Returns
TypeDescription
$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
TypeDescription
Google\Protobuf\Internal\RepeatedField

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
NameDescription
var array<Google\Cloud\Firestore\V1beta1\StructuredQuery\Order>
Returns
TypeDescription
$this

getStartAt

A starting point for the query results.

Returns
TypeDescription
Google\Cloud\Firestore\V1beta1\Cursor

setStartAt

A starting point for the query results.

Parameter
NameDescription
var Google\Cloud\Firestore\V1beta1\Cursor
Returns
TypeDescription
$this

getEndAt

A end point for the query results.

Returns
TypeDescription
Google\Cloud\Firestore\V1beta1\Cursor

setEndAt

A end point for the query results.

Parameter
NameDescription
var Google\Cloud\Firestore\V1beta1\Cursor
Returns
TypeDescription
$this

getOffset

The number of results to skip.

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

Returns
TypeDescription
int

setOffset

The number of results to skip.

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

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getLimit

The maximum number of results to return.

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

Returns
TypeDescription
Google\Protobuf\Int32Value

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
TypeDescription
int|null

setLimit

The maximum number of results to return.

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

Parameter
NameDescription
var Google\Protobuf\Int32Value
Returns
TypeDescription
$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
NameDescription
var int|null
Returns
TypeDescription
$this