Class QueryPartition

java.lang.Object
com.google.cloud.firestore.QueryPartition

public class QueryPartition extends Object
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 getStartAt() and getEndBefore() can only be used in a query that matches the constraint of query that produced this partition.
  • Constructor Details

  • Method Details

    • getStartAt

      @Nullable public Object[] getStartAt()
      The cursor that defines the first result for this partition. null if this is the first partition.
      Returns:
      a cursor value that can be used with Query.startAt(Object...) or null if this is the first partition.
    • getEndBefore

      @Nullable public Object[] getEndBefore()
      The cursor that defines the first result after this partition. null if this is the last partition.
      Returns:
      a cursor value that can be used with Query.endBefore(Object...) or null if this is the last partition.
    • createQuery

      public Query createQuery()
      Returns a query that only returns the documents for this partition.
      Returns:
      a query partitioned by a Query.startAt(Object...) and Query.endBefore(Object...) cursor.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object