list method

Future<ListDocumentsResponse> list (
  1. String parent,
  2. String collectionId,
  3. {List<String> mask_fieldPaths,
  4. String pageToken,
  5. String orderBy,
  6. String readTime,
  7. bool showMissing,
  8. String transaction,
  9. int pageSize,
  10. String $fields}

Lists documents.

Request parameters:

parent - 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 Value must have pattern "^projects/^/+/databases/^/+/documents/^/+/.*$".

collectionId - Required. The collection ID, relative to parent, to list. For example: chatrooms or messages.

mask_fieldPaths - The list of field paths in the mask. See Document.fields for a field path syntax reference.

pageToken - The next_page_token value returned from a previous List request, if any.

orderBy - The order to sort results by. For example: priority desc, name.

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

showMissing - If the list should show missing documents. A missing document is a document that does not exist but has sub-documents. These documents will be returned with a key but will not have fields, Document.create_time, or Document.update_time set. Requests with show_missing may not specify where or order_by.

transaction - Reads documents in a transaction.

pageSize - The maximum number of documents to return.

$fields - Selector specifying which fields to include in a partial response.

Completes with a ListDocumentsResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.


async.Future<ListDocumentsResponse> list(
    core.String parent, core.String collectionId,
    {core.List<core.String> mask_fieldPaths,
    core.String pageToken,
    core.String orderBy,
    core.String readTime,
    core.bool showMissing,
    core.String transaction, pageSize,
    core.String $fields}) {
  var _url;
  var _queryParams = new core.Map<core.String, core.List<core.String>>();
  var _uploadMedia;
  var _uploadOptions;
  var _downloadOptions = commons.DownloadOptions.Metadata;
  var _body;

  if (parent == null) {
    throw new core.ArgumentError("Parameter parent is required.");
  if (collectionId == null) {
    throw new core.ArgumentError("Parameter collectionId is required.");
  if (mask_fieldPaths != null) {
    _queryParams["mask.fieldPaths"] = mask_fieldPaths;
  if (pageToken != null) {
    _queryParams["pageToken"] = [pageToken];
  if (orderBy != null) {
    _queryParams["orderBy"] = [orderBy];
  if (readTime != null) {
    _queryParams["readTime"] = [readTime];
  if (showMissing != null) {
    _queryParams["showMissing"] = ["${showMissing}"];
  if (transaction != null) {
    _queryParams["transaction"] = [transaction];
  if (pageSize != null) {
    _queryParams["pageSize"] = ["${pageSize}"];
  if ($fields != null) {
    _queryParams["fields"] = [$fields];

  _url = 'v1/' +
      commons.Escaper.ecapeVariableReserved('$parent') +
      '/' +

  var _response = _requester.request(_url, "GET",
      body: _body,
      queryParams: _queryParams,
      uploadOptions: _uploadOptions,
      uploadMedia: _uploadMedia,
      downloadOptions: _downloadOptions);
  return _response.then((data) => new ListDocumentsResponse.fromJson(data));