Conector para Firestore (escritura)

Escribe en Firestore con un conector de Workflows.

Muestra de código

YAML

# This workflow demonstrates how to use the Firestore connector:
# Write data to a document in the default Firestore database
# Expected output: "projects/PROJECT_ID/databases/(default)/documents/peopleDatabase/smith.j"
- init_variables:
    assign:
      - project: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}
      - collection: "peopleDatabase"
      - document: "smith.j"
      - values_to_write:
          FirstName:
            stringValue: "John"
          LastName:
            stringValue: "Smith"
          Age:
            integerValue: 32
- write_to_firestore:
    call: googleapis.firestore.v1.projects.databases.documents.patch
    args:
      name: ${"projects/"+project+"/databases/(default)/documents/"+collection+"/"+document}
      body:
        fields: ${values_to_write}
    result: write_result
- last:
    return: ${write_result.name}

¿Qué sigue?

Para buscar y filtrar muestras de código para otros productos de Google Cloud, consulta el navegador de muestra de Google Cloud.