def update(self, reference, field_updates, option=None):
        """Add a "change" to update a document.

        See
        :meth:`~.firestore_v1beta1.document.DocumentReference.update` for
        more information on ``field_updates`` and ``option``.

        Args:
            reference (~.firestore_v1beta1.document.DocumentReference): A
               document reference that will be deleted in this batch.
            field_updates (dict): Field names or paths to update and values
                to update with.
            option (Optional[~.firestore_v1beta1.client.WriteOption]): A
               write option to make assertions / preconditions on the server
               state of the document before applying changes.
        """
        write_pbs = _helpers.pbs_for_update(
            self._client, reference._document_path, field_updates, option)
        self._add_write_pbs(write_pbs)
Example #2
0
    def update(self, reference, field_updates, option=None):
        """Add a "change" to update a document.

        See
        :meth:`~.firestore_v1beta1.document.DocumentReference.update` for
        more information on ``field_updates`` and ``option``.

        Args:
            reference (~.firestore_v1beta1.document.DocumentReference): A
               document reference that will be deleted in this batch.
            field_updates (dict): Field names or paths to update and values
                to update with.
            option (Optional[~.firestore_v1beta1.client.WriteOption]): A
               write option to make assertions / preconditions on the server
               state of the document before applying changes.
        """
        write_pbs = _helpers.pbs_for_update(
            self._client, reference._document_path, field_updates, option)
        self._add_write_pbs(write_pbs)
Example #3
0
    def update(self, reference, field_updates, option=None):
        """Add a "change" to update a document.

        See
        :meth:`~google.cloud.firestore_v1beta1.document.DocumentReference.update`
        for more information on ``field_updates`` and ``option``.

        Args:
            reference (~.firestore_v1beta1.document.DocumentReference): A
               document reference that will be deleted in this batch.
            field_updates (dict): Field names or paths to update and values
                to update with.
            option (Optional[~.firestore_v1beta1.client.WriteOption]): A
               write option to make assertions / preconditions on the server
               state of the document before applying changes.
        """
        if option.__class__.__name__ == "ExistsOption":
            raise ValueError("you must not pass an explicit write option to "
                             "update.")
        write_pbs = _helpers.pbs_for_update(reference._document_path,
                                            field_updates, option)
        self._add_write_pbs(write_pbs)
    def update(self, reference, field_updates, option=None):
        """Add a "change" to update a document.

        See
        :meth:`~google.cloud.firestore_v1beta1.document.DocumentReference.update`
        for more information on ``field_updates`` and ``option``.

        Args:
            reference (~.firestore_v1beta1.document.DocumentReference): A
               document reference that will be deleted in this batch.
            field_updates (dict): Field names or paths to update and values
                to update with.
            option (Optional[~.firestore_v1beta1.client.WriteOption]): A
               write option to make assertions / preconditions on the server
               state of the document before applying changes.
        """
        if option.__class__.__name__ == "ExistsOption":
            raise ValueError("you must not pass an explicit write option to " "update.")
        write_pbs = _helpers.pbs_for_update(
            reference._document_path, field_updates, option
        )
        self._add_write_pbs(write_pbs)
    def _call_fut(client, document_path, field_updates, option):
        from google.cloud.firestore_v1beta1._helpers import pbs_for_update

        return pbs_for_update(client, document_path, field_updates, option)