कंसोल पर जाएं

Method: projects.databases.documents.runQuery

Runs a query.

HTTP request

POST https://firestore.googleapis.com/v1beta1/{parent=projects/*/databases/*/documents}:runQuery

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

The parent resource name. In the format: projects/{project_id}/databases/{database_id}/documents or projects/{project_id}/databases/{database_id}/documents/{document_path}. For example: projects/my-project/databases/my-database/documents or projects/my-project/databases/my-database/documents/chatrooms/my-chatroom

Request body

The request body contains data with the following structure:

JSON representation
{
  "structuredQuery": {
    object(StructuredQuery)
  },

  // Union field consistency_selector can be only one of the following:
  "transaction": string,
  "newTransaction": {
    object(TransactionOptions)
  },
  "readTime": string
  // End of list of possible types for union field consistency_selector.
}
Fields
structuredQuery

object(StructuredQuery)

A structured query.

Union field consistency_selector. The consistency mode for this transaction. If not set, defaults to strong consistency. consistency_selector can be only one of the following:
transaction

string (bytes format)

Reads documents in a transaction.

A base64-encoded string.

newTransaction

object(TransactionOptions)

Starts a new transaction and reads the documents. Defaults to a read-only transaction. The new transaction ID will be returned as the first response in the stream.

readTime

string (Timestamp format)

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

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

Response body

If successful, the response body contains data with the following structure:

The response for Firestore.RunQuery.