ParseQuery<T extends ParseObject> class

The ParseQuery class defines a query that is used to fetch ParseObjects. The most common use case is finding all objects that match a query through the find method.

For example, this sample code fetches all objects of class MyClass It calls a different function depending on whether the fetch succeeded or not.

final query = ParseQuery(className: 'MyClass');
final classes = await query.find();

Constructors

ParseQuery({String? className})
Constructs a query. A default query with no further parameters will retrieve all ParseObjects of the provided class.

Properties

className String
Accessor for the class name.
latefinal
copy ParseQuery<ParseObject>
Constructs a copy of current ParseQuery instance;
no setter
genericType Type
Retrieve Type of ParseObject subclass
no setter
hashCode int
The hash code for this object.
no setterinherited
includes List<String>
Retrieve the nested provided key.
no setter
limit int
Accessor for the limit value.
no setter
order List<String>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedKeys List<String>?
Retrieve the restricted fields
no setter
skip int
Accessor for the skip value.
no setter

Methods

addAscendingOrder(String key) → void
Also sorts the results in ascending order by the given key.
addDescendingOrder(String key) → void
Also sorts the results in descending order by the given key.
addOrder(String key) → void
count({bool useMasterKey = false}) Future<int>
Counts the number of objects that match this query. This does not use caching.
find({bool useMasterKey = false}) Future<List<T>>
Retrieves a list of ParseObjects that satisfy this query from the source in a background thread.
include(String key) → void
Include nested ParseObjects for the provided key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
orderByAscending(String key) → void
Sorts the results in ascending order by the given key.
orderByDescending(String key) → void
Sorts the results in descending order by the given key.
selectKeys(List<String> keys) → void
Restrict the fields of returned {@link ParseObject}s to only include the provided keys.
setLimit(int limit) → void
Controls the maximum number of results that are returned.
setOrder(String key) → void
setSkip(int skip) → void
Controls the number of results to skip before returning any results.
toJson() Map<String, dynamic>
toJsonParams() Map<String, dynamic>
toString() String
A string representation of this object.
inherited
whereContainedIn(String key, List values) → void
Add a constraint to the query that requires a particular key's value to be contained in the provided list of values.
whereContains(String key, String substring, {bool caseInsensitive = false}) → void
Add a constraint for finding string values that contain a provided string.
whereContainsAll(String key, List values) → void
Add a constraint to the query that requires a particular key's value to contain every one of the provided list of values.
whereDoesNotExist(String key) → void
Add a constraint for finding objects that do not contain a given key.
whereDoesNotMatchKeyInQuery(String key, String keyInQuery, ParseQuery<ParseObject> query) → void
Add a constraint to the query that requires a particular key's value does not match any value for a key in the results of another ParseQuery.
whereDoesNotMatchQuery(String key, ParseQuery<ParseObject> query) → void
Add a constraint to the query that requires a particular key's value does not match another ParseQuery.
whereEndsWith(String key, String suffix, {bool caseInsensitive = false}) → void
Add a constraint for finding string values that end with a provided string.
whereEqualTo(String key, dynamic value) → void
Add a constraint to the query that requires a particular key's value to be equal to the provided value.
whereExists(String key) → void
Add a constraint for finding objects that contain the given key.
whereGreaterThan(String key, dynamic value) → void
Add a constraint to the query that requires a particular key's value to be greater than the provided value.
whereGreaterThanOrEqualTo(String key, dynamic value) → void
Add a constraint to the query that requires a particular key's value to be greater than or equal to the provided value.
whereLessThan(String key, dynamic value) → void
Add a constraint to the query that requires a particular key's value to be less than the provided value.
whereLessThanOrEqualTo(String key, dynamic value) → void
Add a constraint to the query that requires a particular key's value to be less than or equal to the provided value.
whereMatches(String key, String regex, [String? modifiers]) → void
Add a regular expression constraint for finding string values that match the provided regular expression.
whereMatchesKeyInQuery(String key, String keyInQuery, ParseQuery<ParseObject> query) → void
Add a constraint to the query that requires a particular key's value matches a value for a key in the results of another ParseQuery.
whereMatchesQuery(String key, ParseQuery<ParseObject> query) → void
Add a constraint to the query that requires a particular key's value match another ParseQuery.
whereNear(String key, ParseGeoPoint point) → void
Add a proximity based constraint for finding objects with key point values near the point given.
whereNotContainedIn(String key, List values) → void
Add a constraint to the query that requires a particular key's value not be contained in the provided list of values.
whereNotEqualTo(String key, dynamic value) → void
Add a constraint to the query that requires a particular key's value to be not equal to the provided value.
wherePolygonContains(String key, ParseGeoPoint point) → void
Add a constraint to the query that requires a particular key's coordinates that contains a ParseGeoPoints
whereStartsWith(String key, String prefix, {bool caseInsensitive = false}) → void
Add a constraint for finding string values that start with a provided string.
whereWithinGeoBox(String key, ParseGeoPoint southwest, ParseGeoPoint northeast) → void
Add a constraint to the query that requires a particular key's coordinates be contained within a given rectangular geographic bounding box.
whereWithinKilometers(String key, ParseGeoPoint point, num maxDistance) → void
Add a proximity based constraint for finding objects with key point values near the point given and within the maximum distance given.
whereWithinPolygon(String key, List<ParseGeoPoint> points) → void
Adds a constraint to the query that requires a particular key's coordinates be contained within and on the bounds of a given polygon. Supports closed and open (last point is connected to first) paths
whereWithinRadians(String key, double maxDistance) → void
Add a proximity based constraint for finding objects with key point values near the point given and within the maximum distance given.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

or<T extends ParseObject>(List<ParseQuery<T>> queries) ParseQuery<T>
Constructs a query that is the {@code or} of the given queries.