Send feedback
Method: googleapis.firestore.v1.projects.databases.documents.partitionQuery
Stay organized with collections
Save and categorize content based on your preferences.
Partitions a query by returning partition cursors that can be used to
run the query in parallel. The returned partition cursors are split
points that can be used by RunQuery as starting/end points for the query
results.
Arguments
Parameters
parent
string
Required. The parent resource name. In the format: projects/{project_id}/databases/{database_id}/documents
. Document resource names are not supported; only database resource names can be specified.
body
object (PartitionQueryRequest )
Required.
Raised exceptions
Exceptions
ConnectionError
In case of a network problem (such as DNS failure or refused connection).
HttpError
If the response status is >= 400 (excluding 429 and 503).
TimeoutError
If a long-running operation takes longer to finish than the specified timeout limit.
TypeError
If an operation or function receives an argument of the wrong type.
ValueError
If an operation or function receives an argument of the right type but an inappropriate value. For example, a negative timeout.
Response
If successful, the response contains an instance of PartitionQueryResponse
.
Subworkflow snippet
Some fields might be optional or required.
To identify required fields, refer to the API documentation .
YAML
- partitionQuery :
call : googleapis.firestore.v1.projects.databases.documents.partitionQuery
args :
parent : ...
body :
pageSize : ...
pageToken : ...
partitionCount : ...
structuredQuery :
endAt :
before : ...
values : ...
from : ...
limit : ...
offset : ...
orderBy : ...
select :
fields : ...
startAt : ...
where :
compositeFilter :
filters : ...
op : ...
fieldFilter :
field :
fieldPath : ...
op : ...
value :
arrayValue :
values : ...
booleanValue : ...
bytesValue : ...
doubleValue : ...
geoPointValue :
latitude : ...
longitude : ...
integerValue : ...
mapValue :
fields : ...
nullValue : ...
referenceValue : ...
stringValue : ...
timestampValue : ...
unaryFilter :
field : ...
op : ...
result : partitionQueryResult
JSON
[
{
"partitionQuery" : {
"call" : "googleapis.firestore.v1.projects.databases.documents.partitionQuery" ,
"args" : {
"parent" : "..." ,
"body" : {
"pageSize" : "..." ,
"pageToken" : "..." ,
"partitionCount" : "..." ,
"structuredQuery" : {
"endAt" : {
"before" : "..." ,
"values" : "..."
},
"from" : "..." ,
"limit" : "..." ,
"offset" : "..." ,
"orderBy" : "..." ,
"select" : {
"fields" : "..."
},
"startAt" : "..." ,
"where" : {
"compositeFilter" : {
"filters" : "..." ,
"op" : "..."
},
"fieldFilter" : {
"field" : {
"fieldPath" : "..."
},
"op" : "..." ,
"value" : {
"arrayValue" : {
"values" : "..."
},
"booleanValue" : "..." ,
"bytesValue" : "..." ,
"doubleValue" : "..." ,
"geoPointValue" : {
"latitude" : "..." ,
"longitude" : "..."
},
"integerValue" : "..." ,
"mapValue" : {
"fields" : "..."
},
"nullValue" : "..." ,
"referenceValue" : "..." ,
"stringValue" : "..." ,
"timestampValue" : "..."
}
},
"unaryFilter" : {
"field" : "..." ,
"op" : "..."
}
}
}
}
},
"result" : "partitionQueryResult"
}
}
]
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-04 UTC.
Need to tell us more?
[[["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-04 UTC."],[],[],null,["# Method: googleapis.firestore.v1.projects.databases.documents.partitionQuery\n\nPartitions a query by returning partition cursors that can be used to\nrun the query in parallel. The returned partition cursors are split\npoints that can be used by RunQuery as starting/end points for the query\nresults.\n\nArguments\n---------\n\nRaised exceptions\n-----------------\n\nResponse\n--------\n\nIf successful, the response contains an instance of [`PartitionQueryResponse`](/workflows/docs/reference/googleapis/firestore/v1/Overview#PartitionQueryResponse).\n\nSubworkflow snippet\n-------------------\n\nSome fields might be optional or required.\nTo identify required fields, refer to the [API documentation](https://cloud.google.com/firestore/docs/reference/rest/v1/projects.databases.documents/partitionQuery). \n\n### YAML\n\n```yaml\n- partitionQuery:\n call: googleapis.firestore.v1.projects.databases.documents.partitionQuery\n args:\n parent: ...\n body:\n pageSize: ...\n pageToken: ...\n partitionCount: ...\n structuredQuery:\n endAt:\n before: ...\n values: ...\n from: ...\n limit: ...\n offset: ...\n orderBy: ...\n select:\n fields: ...\n startAt: ...\n where:\n compositeFilter:\n filters: ...\n op: ...\n fieldFilter:\n field:\n fieldPath: ...\n op: ...\n value:\n arrayValue:\n values: ...\n booleanValue: ...\n bytesValue: ...\n doubleValue: ...\n geoPointValue:\n latitude: ...\n longitude: ...\n integerValue: ...\n mapValue:\n fields: ...\n nullValue: ...\n referenceValue: ...\n stringValue: ...\n timestampValue: ...\n unaryFilter:\n field: ...\n op: ...\n result: partitionQueryResult\n```\n\n### JSON\n\n```json\n[\n {\n \"partitionQuery\": {\n \"call\": \"googleapis.firestore.v1.projects.databases.documents.partitionQuery\",\n \"args\": {\n \"parent\": \"...\",\n \"body\": {\n \"pageSize\": \"...\",\n \"pageToken\": \"...\",\n \"partitionCount\": \"...\",\n \"structuredQuery\": {\n \"endAt\": {\n \"before\": \"...\",\n \"values\": \"...\"\n },\n \"from\": \"...\",\n \"limit\": \"...\",\n \"offset\": \"...\",\n \"orderBy\": \"...\",\n \"select\": {\n \"fields\": \"...\"\n },\n \"startAt\": \"...\",\n \"where\": {\n \"compositeFilter\": {\n \"filters\": \"...\",\n \"op\": \"...\"\n },\n \"fieldFilter\": {\n \"field\": {\n \"fieldPath\": \"...\"\n },\n \"op\": \"...\",\n \"value\": {\n \"arrayValue\": {\n \"values\": \"...\"\n },\n \"booleanValue\": \"...\",\n \"bytesValue\": \"...\",\n \"doubleValue\": \"...\",\n \"geoPointValue\": {\n \"latitude\": \"...\",\n \"longitude\": \"...\"\n },\n \"integerValue\": \"...\",\n \"mapValue\": {\n \"fields\": \"...\"\n },\n \"nullValue\": \"...\",\n \"referenceValue\": \"...\",\n \"stringValue\": \"...\",\n \"timestampValue\": \"...\"\n }\n },\n \"unaryFilter\": {\n \"field\": \"...\",\n \"op\": \"...\"\n }\n }\n }\n }\n },\n \"result\": \"partitionQueryResult\"\n }\n }\n]\n```"]]