younifyd
Menu

Firestore.projects.databases.documents.partition Query

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.

POST/v1/{parent}:partitionQuery

Use it in a workflow

  1. Add a step and choose the Firestore connector.
  2. Pick the Firestore.projects.databases.documents.partition Query action (under projects).
  3. Fill in the fields below, then reference the result from later steps as {{firestoreProjectsDatabasesDocumentsPartitionQuery.response.data}}.

Request

Path parameters

parentstringrequired

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.

Query parameters

$.xgafvstring

V1 error format.

One of12

access_tokenstring

OAuth access token.

altstring

Data format for response.

One ofjsonmediaproto

callbackstring

JSONP

fieldsstring

Selector specifying which fields to include in a partial response.

keystring

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_tokenstring

OAuth 2.0 token for the current user.

prettyPrintboolean

Returns response with indentations and line breaks.

quotaUserstring

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

upload_protocolstring

Upload protocol for media (e.g. "raw", "multipart").

uploadTypestring

Legacy upload protocol for media (e.g. "media", "multipart").

Request body

Enter the body as JSON in the step's Body field.

pageSizeinteger (int32)

The maximum number of partitions to return in this call, subject to `partition_count`. For example, if `partition_count` = 10 and `page_size` = 8, the first call to PartitionQuery will return up to 8 partitions and a `next_page_token` if more results exist. A second call to PartitionQuery will return up to 2 partitions, to complete the total of 10 specified in `partition_count`.

pageTokenstring

The `next_page_token` value returned from a previous call to PartitionQuery that may be used to get an additional set of results. There are no ordering guarantees between sets of results. Thus, using multiple sets of results will require merging the different result sets. For example, two subsequent calls using a page_token may return: * cursor B, cursor M, cursor Q * cursor A, cursor U, cursor W To obtain a complete result set ordered with respect to the results of the query supplied to PartitionQuery, the results sets should be merged: cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W

partitionCountstring (int64)

The desired maximum number of partition points. The partitions may be returned across multiple pages of results. The number must be positive. The actual number of partitions returned may be fewer. For example, this may be set to one fewer than the number of parallel queries to be run, or in running a data pipeline job, one fewer than the number of workers or compute instances available.

readTimestring (google-datetime)

Reads documents as they were at the given time. This may not be older than 270 seconds.

structuredQueryobject

A Firestore query.

endAtobject2 fields

A position in a query result set.

fromarray<object>2 fields

The collections to query.

limitinteger (int32)

The maximum number of results to return. Applies after all other constraints. Requires: * The value must be greater than or equal to zero if specified.

offsetinteger (int32)

The number of documents to skip before returning the first result. This applies after the constraints specified by the `WHERE`, `START AT`, & `END AT` but before the `LIMIT` clause. Requires: * The value must be greater than or equal to zero if specified.

orderByarray<object>2 fields

The order to apply to the query results. Firestore allows callers to provide a full ordering, a partial ordering, or no ordering at all. In all cases, Firestore guarantees a stable ordering through the following rules: * The `order_by` is required to reference all fields used with an inequality filter. * All fields that are required to be in the `order_by` but are not already present are appended in lexicographical ordering of the field name. * If an order on `__name__` is not specified, it is appended by default. Fields are appended with the same sort direction as the last order specified, or 'ASCENDING' if no order was specified. For example: * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC` * `WHERE __name__ > ... AND a > 1` becomes `WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC`

selectobject1 fields

The projection of document's fields to return.

startAtobject2 fields

A position in a query result set.

whereobject3 fields

A filter.

json
{
  "pageSize": 0,
  "pageToken": "string",
  "partitionCount": "string",
  "readTime": "string",
  "structuredQuery": {
    "endAt": {
      "before": false,
      "values": [
        {
          "arrayValue": {
            "values": [
              null
            ]
          },
          "booleanValue": false,
          "bytesValue": "string",
          "doubleValue": 0,
          "geoPointValue": {
            "latitude": 0,
            "longitude": 0
          },
          "integerValue": "string",
          "mapValue": {
            "fields": {}
          },
          "nullValue": "NULL_VALUE",
          "referenceValue": "string",
          "stringValue": "string",
          "timestampValue": "string"
        }
      ]
    },
    "from": [
      {
        "allDescendants": false,
        "collectionId": "string"
      }
    ],
    "limit": 0,
    "offset": 0,
    "orderBy": [
      {
        "direction": "DIRECTION_UNSPECIFIED",
        "field": {
          "fieldPath": "string"
        }
      }
    ],
    "select": {
      "fields": [
        {
          "fieldPath": "string"
        }
      ]
    },
    "startAt": {
      "before": false,
      "values": [
        {
          "arrayValue": {
            "values": [
              null
            ]
          },
          "booleanValue": false,
          "bytesValue": "string",
          "doubleValue": 0,
          "geoPointValue": {
            "latitude": 0,
            "longitude": 0
          },
          "integerValue": "string",
          "mapValue": {
            "fields": {}
          },
          "nullValue": "NULL_VALUE",
          "referenceValue": "string",
          "stringValue": "string",
          "timestampValue": "string"
        }
      ]
    },
    "where": {
      "compositeFilter": {
        "filters": [
          {}
        ],
        "op": "OPERATOR_UNSPECIFIED"
      },
      "fieldFilter": {
        "field": {
          "fieldPath": "string"
        },
        "op": "OPERATOR_UNSPECIFIED",
        "value": {
          "arrayValue": {
            "values": [
              null
            ]
          },
          "booleanValue": false,
          "bytesValue": "string",
          "doubleValue": 0,
          "geoPointValue": {
            "latitude": 0,
            "longitude": 0
          },
          "integerValue": "string",
          "mapValue": {
            "fields": {}
          },
          "nullValue": "NULL_VALUE",
          "referenceValue": "string",
          "stringValue": "string",
          "timestampValue": "string"
        }
      },
      "unaryFilter": {
        "field": {
          "fieldPath": "string"
        },
        "op": "OPERATOR_UNSPECIFIED"
      }
    }
  }
}

Response

Returns 200 with an object. Read it in later steps with {{firestoreProjectsDatabasesDocumentsPartitionQuery.response.data.<field>}}.

nextPageTokenstring

A page token that may be used to request an additional set of results, up to the number specified by `partition_count` in the PartitionQuery request. If blank, there are no more results.

partitionsarray<object>

Partition results. Each partition is a split point that can be used by RunQuery as a starting or end point for the query results. The RunQuery requests must be made with the same query supplied to this PartitionQuery request. The partition cursors will be ordered according to same ordering as the results of the query supplied to PartitionQuery. For example, if a PartitionQuery request returns partition cursors A and B, running the following three queries will return the entire result set of the original query: * query, end_at A * query, start_at A, end_at B * query, start_at B An empty result may indicate that the query has too few results to be partitioned.

beforeboolean

If the position is just before or just after the given values, relative to the sort order defined by the query.

valuesarray<object>11 fields

The values that represent a position, in the order they appear in the order by clause of a query. Can contain fewer values than specified in the order by clause.

json
{
  "nextPageToken": "string",
  "partitions": [
    {
      "before": false,
      "values": [
        {
          "arrayValue": {
            "values": [
              null
            ]
          },
          "booleanValue": false,
          "bytesValue": "string",
          "doubleValue": 0,
          "geoPointValue": {
            "latitude": 0,
            "longitude": 0
          },
          "integerValue": "string",
          "mapValue": {
            "fields": {}
          },
          "nullValue": "NULL_VALUE",
          "referenceValue": "string",
          "stringValue": "string",
          "timestampValue": "string"
        }
      ]
    }
  ]
}

Need more? See the Firestore guide for connection setup and behaviour shared by every action.