java.lang.Object | |
↳ | com.google.firebase.firestore.Query |
![]() |
A Query which you can read or listen to. You can also construct refined Query objects by adding filters and ordering.
Subclassing Note: Firestore classes are not meant to be subclassed except for use in test mocks. Subclassing is not supported in production code and new SDK releases may break code that does so.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Query.Direction | An enum for the direction of a sort. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Starts listening to this query using an Activity-scoped listener.
| |||||||||||
Starts listening to this query with the given options, using an Activity-scoped listener.
| |||||||||||
Starts listening to this query.
| |||||||||||
Starts listening to this query with the given options.
| |||||||||||
Starts listening to this query with the given options.
| |||||||||||
Starts listening to this query.
| |||||||||||
Creates and returns a new Query that ends at the provided document (inclusive).
| |||||||||||
Creates and returns a new Query that ends at the provided fields relative to the order of the
query.
| |||||||||||
Creates and returns a new Query that ends before the provided document (exclusive).
| |||||||||||
Creates and returns a new Query that ends before the provided fields relative to the order of
the query.
| |||||||||||
Executes the query and returns the results as QuerySnapshot.
| |||||||||||
Gets the Firestore instance associated with this query.
| |||||||||||
Creates and returns a new Query that's additionally limited to only return up to the specified
number of documents.
| |||||||||||
Creates and returns a new Query that's additionally sorted by the specified field, optionally
in descending order instead of ascending.
| |||||||||||
Creates and returns a new Query that's additionally sorted by the specified field.
| |||||||||||
Creates and returns a new Query that's additionally sorted by the specified field, optionally
in descending order instead of ascending.
| |||||||||||
Creates and returns a new Query that's additionally sorted by the specified field.
| |||||||||||
Creates and returns a new Query that starts after the provided fields relative to the order of
the query.
| |||||||||||
Creates and returns a new Query that starts after the provided document (exclusive).
| |||||||||||
Creates and returns a new Query that starts at the provided fields relative to the order of the
query.
| |||||||||||
Creates and returns a new Query that starts at the provided document (inclusive).
| |||||||||||
Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be equal to the specified value.
| |||||||||||
Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be equal to the specified value.
| |||||||||||
Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be greater than the specified value.
| |||||||||||
Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be greater than the specified value.
| |||||||||||
Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be greater than or equal to the specified value.
| |||||||||||
Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be greater than or equal to the specified value.
| |||||||||||
Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be less than the specified value.
| |||||||||||
Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be less than the specified value.
| |||||||||||
Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be less than or equal to the specified value.
| |||||||||||
Creates and returns a new Query with the additional filter that documents must contain the
specified field and the value should be less than or equal to the specified value.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Starts listening to this query using an Activity-scoped listener.
The listener will be automatically removed during onStop()
.
Parameters | |
---|---|
activity |
Activity : The activity to scope the listener to. |
listener |
EventListener : The event listener that will be called with the snapshots. |
Returns | |
---|---|
ListenerRegistration |
A registration object that can be used to remove the listener. |
Starts listening to this query with the given options, using an Activity-scoped listener.
The listener will be automatically removed during onStop()
.
Parameters | |
---|---|
activity |
Activity : The activity to scope the listener to. |
options |
QueryListenOptions : The options to use for this listen. |
listener |
EventListener : The event listener that will be called with the snapshots. |
Returns | |
---|---|
ListenerRegistration |
A registration object that can be used to remove the listener. |
Starts listening to this query.
Parameters | |
---|---|
executor |
Executor : The executor to use to call the listener. |
listener |
EventListener : The event listener that will be called with the snapshots. |
Returns | |
---|---|
ListenerRegistration |
A registration object that can be used to remove the listener. |
Starts listening to this query with the given options.
Parameters | |
---|---|
executor |
Executor : The executor to use to call the listener. |
options |
QueryListenOptions : The options to use for this listen. |
listener |
EventListener : The event listener that will be called with the snapshots. |
Returns | |
---|---|
ListenerRegistration |
A registration object that can be used to remove the listener. |
Starts listening to this query with the given options.
Parameters | |
---|---|
options |
QueryListenOptions : The options to use for this listen. |
listener |
EventListener : The event listener that will be called with the snapshots. |
Returns | |
---|---|
ListenerRegistration |
A registration object that can be used to remove the listener. |
Starts listening to this query.
Parameters | |
---|---|
listener |
EventListener : The event listener that will be called with the snapshots. |
Returns | |
---|---|
ListenerRegistration |
A registration object that can be used to remove the listener. |
Creates and returns a new Query that ends at the provided document (inclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query.
Parameters | |
---|---|
snapshot |
DocumentSnapshot : The snapshot of the document to end at. |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query that ends at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query.
Parameters | |
---|---|
fieldValues |
Object : The field values to end this query at, in order of the query's order by. |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query that ends before the provided document (exclusive). The end position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query.
Parameters | |
---|---|
snapshot |
DocumentSnapshot : The snapshot of the document to end before. |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query that ends before the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query.
Parameters | |
---|---|
fieldValues |
Object : The field values to end this query before, in order of the query's order by. |
Returns | |
---|---|
Query |
The created Query. |
Parameters | |
---|---|
o |
Object |
Returns | |
---|---|
boolean |
Executes the query and returns the results as QuerySnapshot.
Returns | |
---|---|
Task<QuerySnapshot> |
A Task that will be resolved with the results of the Query. |
Gets the Firestore instance associated with this query.
Returns | |
---|---|
FirebaseFirestore |
Returns | |
---|---|
int |
Creates and returns a new Query that's additionally limited to only return up to the specified number of documents.
Parameters | |
---|---|
limit |
long : The maximum number of items to return. |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query that's additionally sorted by the specified field, optionally in descending order instead of ascending.
Parameters | |
---|---|
field |
String : The field to sort by. |
direction |
Query.Direction : The direction to sort. |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query that's additionally sorted by the specified field.
Parameters | |
---|---|
fieldPath |
FieldPath : The field to sort by. |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query that's additionally sorted by the specified field, optionally in descending order instead of ascending.
Parameters | |
---|---|
fieldPath |
FieldPath : The field to sort by. |
direction |
Query.Direction : The direction to sort. |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query that's additionally sorted by the specified field.
Parameters | |
---|---|
field |
String : The field to sort by. |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query that starts after the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query.
Parameters | |
---|---|
fieldValues |
Object : The field values to start this query after, in order of the query's order
by. |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query that starts after the provided document (exclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query.
Parameters | |
---|---|
snapshot |
DocumentSnapshot : The snapshot of the document to start after. |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query that starts at the provided fields relative to the order of the query. The order of the field values must match the order of the order by clauses of the query.
Parameters | |
---|---|
fieldValues |
Object : The field values to start this query at, in order of the query's order by. |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query that starts at the provided document (inclusive). The starting position is relative to the order of the query. The document must contain all of the fields provided in the orderBy of this query.
Parameters | |
---|---|
snapshot |
DocumentSnapshot : The snapshot of the document to start at. |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be equal to the specified value.
Parameters | |
---|---|
field |
String : The name of the field to compare |
value |
Object : The value for comparison |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be equal to the specified value.
Parameters | |
---|---|
fieldPath |
FieldPath : The path of the field to compare |
value |
Object : The value for comparison |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be greater than the specified value.
Parameters | |
---|---|
fieldPath |
FieldPath : The path of the field to compare |
value |
Object : The value for comparison |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be greater than the specified value.
Parameters | |
---|---|
field |
String : The name of the field to compare |
value |
Object : The value for comparison |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be greater than or equal to the specified value.
Parameters | |
---|---|
field |
String : The name of the field to compare |
value |
Object : The value for comparison |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be greater than or equal to the specified value.
Parameters | |
---|---|
fieldPath |
FieldPath : The path of the field to compare |
value |
Object : The value for comparison |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be less than the specified value.
Parameters | |
---|---|
field |
String : The name of the field to compare |
value |
Object : The value for comparison |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be less than the specified value.
Parameters | |
---|---|
fieldPath |
FieldPath : The path of the field to compare |
value |
Object : The value for comparison |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be less than or equal to the specified value.
Parameters | |
---|---|
fieldPath |
FieldPath : The path of the field to compare |
value |
Object : The value for comparison |
Returns | |
---|---|
Query |
The created Query. |
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be less than or equal to the specified value.
Parameters | |
---|---|
field |
String : The name of the field to compare |
value |
Object : The value for comparison |
Returns | |
---|---|
Query |
The created Query. |