The cursor values that define the first result after this partition, or nil if this is the last partition.
Returns an array of values that represent a position, in the order they appear in the order by clause of the
query. Can contain fewer values than specified in the order by clause. Will be used in the query returned by
#to_query.
Returns
(Array<Object>, nil) — Typically, the values are DocumentReference objects.
#start_at
defstart_at()->Array<Object>,nil
The cursor values that define the first result for this partition, or nil if this is the first partition.
Returns an array of values that represent a position, in the order they appear in the order by clause of the
query. Can contain fewer values than specified in the order by clause. Will be used in the query returned by
#to_query.
Returns
(Array<Object>, nil) — Typically, the values are DocumentReference objects.
#to_query
defto_query()->Query
Creates a new query that only returns the documents for this partition, using the cursor values from
#start_at and #end_before.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Cloud Firestore API - Class Google::Cloud::Firestore::QueryPartition (v3.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.1.0 (latest)](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-QueryPartition)\n- [3.0.0](/ruby/docs/reference/google-cloud-firestore/3.0.0/Google-Cloud-Firestore-QueryPartition)\n- [2.16.1](/ruby/docs/reference/google-cloud-firestore/2.16.1/Google-Cloud-Firestore-QueryPartition)\n- [2.15.1](/ruby/docs/reference/google-cloud-firestore/2.15.1/Google-Cloud-Firestore-QueryPartition)\n- [2.14.0](/ruby/docs/reference/google-cloud-firestore/2.14.0/Google-Cloud-Firestore-QueryPartition)\n- [2.13.1](/ruby/docs/reference/google-cloud-firestore/2.13.1/Google-Cloud-Firestore-QueryPartition)\n- [2.12.0](/ruby/docs/reference/google-cloud-firestore/2.12.0/Google-Cloud-Firestore-QueryPartition)\n- [2.11.0](/ruby/docs/reference/google-cloud-firestore/2.11.0/Google-Cloud-Firestore-QueryPartition)\n- [2.10.1](/ruby/docs/reference/google-cloud-firestore/2.10.1/Google-Cloud-Firestore-QueryPartition)\n- [2.9.1](/ruby/docs/reference/google-cloud-firestore/2.9.1/Google-Cloud-Firestore-QueryPartition)\n- [2.8.0](/ruby/docs/reference/google-cloud-firestore/2.8.0/Google-Cloud-Firestore-QueryPartition)\n- [2.7.2](/ruby/docs/reference/google-cloud-firestore/2.7.2/Google-Cloud-Firestore-QueryPartition)\n- [2.6.6](/ruby/docs/reference/google-cloud-firestore/2.6.6/Google-Cloud-Firestore-QueryPartition) \nReference documentation and code samples for the Cloud Firestore API class Google::Cloud::Firestore::QueryPartition.\n\nQueryPartition\n--------------\n\nRepresents a split point that can be used in a query as a starting and/or end point for the query results.\n\nThe cursors returned by [#start_at](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-QueryPartition#Google__Cloud__Firestore__QueryPartition_start_at_instance_ \"Google::Cloud::Firestore::QueryPartition#start_at (method)\") and [#end_before](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-QueryPartition#Google__Cloud__Firestore__QueryPartition_end_before_instance_ \"Google::Cloud::Firestore::QueryPartition#end_before (method)\") can only be used in a query that matches the constraint of\nthe query that produced this partition.\n\nSee [CollectionGroup#partitions](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-CollectionGroup#Google__Cloud__Firestore__CollectionGroup_partitions_instance_ \"Google::Cloud::Firestore::CollectionGroup#partitions (method)\") and [Query](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-Query \"Google::Cloud::Firestore::Query (class)\"). \n\nInherits\n--------\n\n- Object\n\nExample\n-------\n\n```ruby\nrequire \"google/cloud/firestore\"\n\nfirestore = Google::Cloud::Firestore.new\n\ncol_group = firestore.col_group \"cities\"\n\npartitions = col_group.partitions 3\n\nqueries = partitions.map(&:to_query)\n```\n\nMethods\n-------\n\n### #end_before\n\n def end_before() -\u003e Array\u003cObject\u003e, nil\n\nThe cursor values that define the first result after this partition, or `nil` if this is the last partition.\nReturns an array of values that represent a position, in the order they appear in the order by clause of the\nquery. Can contain fewer values than specified in the order by clause. Will be used in the query returned by\n[#to_query](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-QueryPartition#Google__Cloud__Firestore__QueryPartition_to_query_instance_ \"Google::Cloud::Firestore::QueryPartition#to_query (method)\"). \n**Returns**\n\n- (Array\\\u003cObject\\\u003e, nil) --- Typically, the values are [DocumentReference](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-DocumentReference \"Google::Cloud::Firestore::DocumentReference (class)\") objects.\n\n### #start_at\n\n def start_at() -\u003e Array\u003cObject\u003e, nil\n\nThe cursor values that define the first result for this partition, or `nil` if this is the first partition.\nReturns an array of values that represent a position, in the order they appear in the order by clause of the\nquery. Can contain fewer values than specified in the order by clause. Will be used in the query returned by\n[#to_query](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-QueryPartition#Google__Cloud__Firestore__QueryPartition_to_query_instance_ \"Google::Cloud::Firestore::QueryPartition#to_query (method)\"). \n**Returns**\n\n- (Array\\\u003cObject\\\u003e, nil) --- Typically, the values are [DocumentReference](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-DocumentReference \"Google::Cloud::Firestore::DocumentReference (class)\") objects.\n\n### #to_query\n\n def to_query() -\u003e Query\n\nCreates a new query that only returns the documents for this partition, using the cursor values from\n[#start_at](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-QueryPartition#Google__Cloud__Firestore__QueryPartition_start_at_instance_ \"Google::Cloud::Firestore::QueryPartition#start_at (method)\") and [#end_before](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-QueryPartition#Google__Cloud__Firestore__QueryPartition_end_before_instance_ \"Google::Cloud::Firestore::QueryPartition#end_before (method)\"). \n**Returns**\n\n- ([Query](./Google-Cloud-Firestore-Query)) --- The query for the partition."]]