A split point that can be used in a query as a starting and/or end point for the query results. The cursors returned by and can only be used in a query that matches the constraint of query that produced this partition.
QueryPartition
Package
@google-cloud/firestore!Constructors
(constructor)(_firestore, _collectionId, _converter, _startAt, _endBefore)
constructor(_firestore: Firestore, _collectionId: string, _converter: firestore.FirestoreDataConverter<T>, _startAt: api.IValue[] | undefined, _endBefore: api.IValue[] | undefined);
Constructs a new instance of the QueryPartition
class
Name | Description |
_firestore |
Firestore
|
_collectionId |
string
|
_converter |
FirebaseFirestore.FirestoreDataConverter<T>
|
_startAt |
google.firestore.v1.IValue[] | undefined
|
_endBefore |
google.firestore.v1.IValue[] | undefined
|
Properties
endBefore
get endBefore(): unknown[] | undefined;
The cursor that defines the first result after this partition or undefined
if this is the last partition. The cursor value must be destructured when passed to endBefore()
(for example with query.endBefore(...queryPartition.endBefore)
).
Type | Description |
unknown[] | undefined |
startAt
get startAt(): unknown[] | undefined;
The cursor that defines the first result for this partition or undefined
if this is the first partition. The cursor value must be destructured when passed to startAt()
(for example with query.startAt(...queryPartition.startAt)
).
Type | Description |
unknown[] | undefined |
Methods
toQuery()
toQuery(): Query<T>;
Returns a query that only encapsulates the documents for this partition.
Type | Description |
Query<T> |