Class Query
java.lang.Object
com.codename1.cloud.firebase.Query
Builds a Firestore structured query.
com.codename1.cloud.firebase.Query q = com.codename1.cloud.firebase.Query.collection("cities")
.where("state", "==", "CA")
.where("population", ">", 100000)
.orderBy("population", false)
.limit(10);
Log.p(q.toString());
Operators: <, <=, >, >=, ==, !=, array-contains,
array-contains-any, in and not-in. Several where calls combine
with AND.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Querycollection(String collectionId) Starts a query over one collection.static QuerycollectionGroup(String collectionId) Starts a query over every collection with this ID at any depth.Returns
limit(int limit) Limits the number of results.offset(int offset) Skips results.Adds a sort order.Returns only the listed fields.toString()Returns a string representation of the object.Returns
Adds a field filter.
-
Method Details
-
collection
-
collectionGroup
-
getCollectionId
Returns
the collection ID this query reads
-
where
Adds a field filter.
Parameters
-
field: the field path -
op: one of the operators listed in the class description -
value: the operand, encoded withFirestoreValues
Returns
this query
-
-
orderBy
-
limit
Limits the number of results.
Parameters
limit: the maximum number of documents
Returns
this query
-
offset
Skips results.
Parameters
offset: the number of documents to skip
Returns
this query
-
select
-
toStructuredQuery
-
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-