Reference documentation and code samples for the Cloud Firestore V1 Client class ListDocumentsRequest.
The request for
Firestore.ListDocuments.
Generated from protobuf message google.firestore.v1.ListDocumentsRequest
Namespace
Google \ Cloud \ Firestore \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ parent
string
Required. 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
↳ collection_id
string
Optional. The collection ID, relative to parent, to list. For example: chatrooms or messages. This is optional, and when not provided, Firestore will list documents from all collections under the provided parent.
↳ page_size
int
Optional. The maximum number of documents to return in a single response. Firestore may return fewer than this value.
↳ page_token
string
Optional. A page token, received from a previous ListDocuments response. Provide this to retrieve the subsequent page. When paginating, all other parameters (with the exception of page_size) must match the values set in the request that generated the page token.
↳ order_by
string
Optional. The optional ordering of the documents to return. For example: priority desc, __name__ desc. This mirrors the ORDER BY used in Firestore queries but in a string representation. When absent, documents are ordered based on __name__ ASC.
Optional. The fields to return. If not set, returns all fields. If a document has a field that is not present in this mask, that field will not be returned in the response.
↳ transaction
string
Perform the read as part of an already active transaction.
Perform the read at the provided time. This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.
↳ show_missing
bool
If the list should show missing documents. A document is missing if it does not exist, but there are sub-documents nested underneath it. When true, such missing documents will be returned with a key but will not have fields, create_time, or update_time set. Requests with show_missing may not specify where or order_by.
getParent
Required. 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
Returns
Type
Description
string
setParent
Required. 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
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getCollectionId
Optional. The collection ID, relative to parent, to list.
For example: chatrooms or messages.
This is optional, and when not provided, Firestore will list documents
from all collections under the provided parent.
Returns
Type
Description
string
setCollectionId
Optional. The collection ID, relative to parent, to list.
For example: chatrooms or messages.
This is optional, and when not provided, Firestore will list documents
from all collections under the provided parent.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getPageSize
Optional. The maximum number of documents to return in a single response.
Firestore may return fewer than this value.
Returns
Type
Description
int
setPageSize
Optional. The maximum number of documents to return in a single response.
Firestore may return fewer than this value.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getPageToken
Optional. A page token, received from a previous ListDocuments response.
Provide this to retrieve the subsequent page. When paginating, all other
parameters (with the exception of page_size) must match the values set
in the request that generated the page token.
Returns
Type
Description
string
setPageToken
Optional. A page token, received from a previous ListDocuments response.
Provide this to retrieve the subsequent page. When paginating, all other
parameters (with the exception of page_size) must match the values set
in the request that generated the page token.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getOrderBy
Optional. The optional ordering of the documents to return.
For example: priority desc, __name__ desc.
This mirrors the ORDER BY
used in Firestore queries but in a string representation. When absent,
documents are ordered based on __name__ ASC.
Returns
Type
Description
string
setOrderBy
Optional. The optional ordering of the documents to return.
For example: priority desc, __name__ desc.
This mirrors the ORDER BY
used in Firestore queries but in a string representation. When absent,
documents are ordered based on __name__ ASC.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getMask
Optional. The fields to return. If not set, returns all fields.
If a document has a field that is not present in this mask, that field
will not be returned in the response.
Perform the read as part of an already active transaction.
Returns
Type
Description
string
hasTransaction
setTransaction
Perform the read as part of an already active transaction.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getReadTime
Perform the read at the provided time.
This must be a microsecond precision timestamp within the past one hour,
or if Point-in-Time Recovery is enabled, can additionally be a whole
minute timestamp within the past 7 days.
This must be a microsecond precision timestamp within the past one hour,
or if Point-in-Time Recovery is enabled, can additionally be a whole
minute timestamp within the past 7 days.
A document is missing if it does not exist, but there are sub-documents
nested underneath it. When true, such missing documents will be returned
with a key but will not have fields,
create_time, or
update_time set.
Requests with show_missing may not specify where or order_by.
Returns
Type
Description
bool
setShowMissing
If the list should show missing documents.
A document is missing if it does not exist, but there are sub-documents
nested underneath it. When true, such missing documents will be returned
with a key but will not have fields,
create_time, or
update_time set.
Requests with show_missing may not specify where or order_by.
[[["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,["# Cloud Firestore V1 Client - Class ListDocumentsRequest (1.53.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.53.0 (latest)](/php/docs/reference/cloud-firestore/latest/V1.ListDocumentsRequest)\n- [1.52.0](/php/docs/reference/cloud-firestore/1.52.0/V1.ListDocumentsRequest)\n- [1.51.0](/php/docs/reference/cloud-firestore/1.51.0/V1.ListDocumentsRequest)\n- [1.50.0](/php/docs/reference/cloud-firestore/1.50.0/V1.ListDocumentsRequest)\n- [1.48.1](/php/docs/reference/cloud-firestore/1.48.1/V1.ListDocumentsRequest)\n- [1.47.3](/php/docs/reference/cloud-firestore/1.47.3/V1.ListDocumentsRequest)\n- [1.46.0](/php/docs/reference/cloud-firestore/1.46.0/V1.ListDocumentsRequest)\n- [1.45.2](/php/docs/reference/cloud-firestore/1.45.2/V1.ListDocumentsRequest)\n- [1.44.1](/php/docs/reference/cloud-firestore/1.44.1/V1.ListDocumentsRequest)\n- [1.43.3](/php/docs/reference/cloud-firestore/1.43.3/V1.ListDocumentsRequest)\n- [1.40.0](/php/docs/reference/cloud-firestore/1.40.0/V1.ListDocumentsRequest)\n- [1.39.0](/php/docs/reference/cloud-firestore/1.39.0/V1.ListDocumentsRequest)\n- [1.38.0](/php/docs/reference/cloud-firestore/1.38.0/V1.ListDocumentsRequest)\n- [1.37.7](/php/docs/reference/cloud-firestore/1.37.7/V1.ListDocumentsRequest)\n- [1.36.1](/php/docs/reference/cloud-firestore/1.36.1/V1.ListDocumentsRequest)\n- [1.35.0](/php/docs/reference/cloud-firestore/1.35.0/V1.ListDocumentsRequest)\n- [1.34.0](/php/docs/reference/cloud-firestore/1.34.0/V1.ListDocumentsRequest)\n- [1.33.0](/php/docs/reference/cloud-firestore/1.33.0/V1.ListDocumentsRequest)\n- [1.32.0](/php/docs/reference/cloud-firestore/1.32.0/V1.ListDocumentsRequest)\n- [1.31.0](/php/docs/reference/cloud-firestore/1.31.0/V1.ListDocumentsRequest)\n- [1.30.0](/php/docs/reference/cloud-firestore/1.30.0/V1.ListDocumentsRequest)\n- [1.28.0](/php/docs/reference/cloud-firestore/1.28.0/V1.ListDocumentsRequest)\n- [1.27.3](/php/docs/reference/cloud-firestore/1.27.3/V1.ListDocumentsRequest) \nReference documentation and code samples for the Cloud Firestore V1 Client class ListDocumentsRequest.\n\nThe request for\nFirestore.ListDocuments.\n\nGenerated from protobuf message `google.firestore.v1.ListDocumentsRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Firestore \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getParent\n\nRequired. The parent resource name. In the format:\n`projects/{project_id}/databases/{database_id}/documents` or\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\n\nFor example:\n`projects/my-project/databases/my-database/documents` or\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`\n\n### setParent\n\nRequired. The parent resource name. In the format:\n`projects/{project_id}/databases/{database_id}/documents` or\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\n\nFor example:\n`projects/my-project/databases/my-database/documents` or\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`\n\n### getCollectionId\n\nOptional. The collection ID, relative to `parent`, to list.\n\nFor example: `chatrooms` or `messages`.\nThis is optional, and when not provided, Firestore will list documents\nfrom all collections under the provided `parent`.\n\n### setCollectionId\n\nOptional. The collection ID, relative to `parent`, to list.\n\nFor example: `chatrooms` or `messages`.\nThis is optional, and when not provided, Firestore will list documents\nfrom all collections under the provided `parent`.\n\n### getPageSize\n\nOptional. The maximum number of documents to return in a single response.\n\nFirestore may return fewer than this value.\n\n### setPageSize\n\nOptional. The maximum number of documents to return in a single response.\n\nFirestore may return fewer than this value.\n\n### getPageToken\n\nOptional. A page token, received from a previous `ListDocuments` response.\n\nProvide this to retrieve the subsequent page. When paginating, all other\nparameters (with the exception of `page_size`) must match the values set\nin the request that generated the page token.\n\n### setPageToken\n\nOptional. A page token, received from a previous `ListDocuments` response.\n\nProvide this to retrieve the subsequent page. When paginating, all other\nparameters (with the exception of `page_size`) must match the values set\nin the request that generated the page token.\n\n### getOrderBy\n\nOptional. The optional ordering of the documents to return.\n\nFor example: `priority desc, __name__ desc`.\nThis mirrors the [`ORDER BY`](/php/docs/reference/cloud-firestore/latest/V1.StructuredQuery#_Google_Cloud_Firestore_V1_StructuredQuery__getOrderBy__)\nused in Firestore queries but in a string representation. When absent,\ndocuments are ordered based on `__name__ ASC`.\n\n### setOrderBy\n\nOptional. The optional ordering of the documents to return.\n\nFor example: `priority desc, __name__ desc`.\nThis mirrors the [`ORDER BY`](/php/docs/reference/cloud-firestore/latest/V1.StructuredQuery#_Google_Cloud_Firestore_V1_StructuredQuery__getOrderBy__)\nused in Firestore queries but in a string representation. When absent,\ndocuments are ordered based on `__name__ ASC`.\n\n### getMask\n\nOptional. The fields to return. If not set, returns all fields.\n\nIf a document has a field that is not present in this mask, that field\nwill not be returned in the response.\n\n### hasMask\n\n### clearMask\n\n### setMask\n\nOptional. The fields to return. If not set, returns all fields.\n\nIf a document has a field that is not present in this mask, that field\nwill not be returned in the response.\n\n### getTransaction\n\nPerform the read as part of an already active transaction.\n\n### hasTransaction\n\n### setTransaction\n\nPerform the read as part of an already active transaction.\n\n### getReadTime\n\nPerform the read at the provided time.\n\nThis must be a microsecond precision timestamp within the past one hour,\nor if Point-in-Time Recovery is enabled, can additionally be a whole\nminute timestamp within the past 7 days.\n\n### hasReadTime\n\n### setReadTime\n\nPerform the read at the provided time.\n\nThis must be a microsecond precision timestamp within the past one hour,\nor if Point-in-Time Recovery is enabled, can additionally be a whole\nminute timestamp within the past 7 days.\n\n### getShowMissing\n\nIf the list should show missing documents.\n\nA document is missing if it does not exist, but there are sub-documents\nnested underneath it. When true, such missing documents will be returned\nwith a key but will not have fields,\n[`create_time`](/php/docs/reference/cloud-firestore/latest/V1.Document#_Google_Cloud_Firestore_V1_Document__getCreateTime__), or\n[`update_time`](/php/docs/reference/cloud-firestore/latest/V1.Document#_Google_Cloud_Firestore_V1_Document__getUpdateTime__) set.\nRequests with `show_missing` may not specify `where` or `order_by`.\n\n### setShowMissing\n\nIf the list should show missing documents.\n\nA document is missing if it does not exist, but there are sub-documents\nnested underneath it. When true, such missing documents will be returned\nwith a key but will not have fields,\n[`create_time`](/php/docs/reference/cloud-firestore/latest/V1.Document#_Google_Cloud_Firestore_V1_Document__getCreateTime__), or\n[`update_time`](/php/docs/reference/cloud-firestore/latest/V1.Document#_Google_Cloud_Firestore_V1_Document__getUpdateTime__) set.\nRequests with `show_missing` may not specify `where` or `order_by`.\n\n### getConsistencySelector"]]