def update(self, id, data):
        """
        Replaces document with _id = id with data.

        :param id: _id of document to update
        :type id: ``string``
        :param data: the new document to insert
        :type data: ``string``

        :return: id of replaced document
        :rtype: ``dict``
        """
        return json.loads(self._post(UrlEncoded(str(id)), headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8'))
Replaces document with _id = id with data.

        :param id: _id of document to update
        :type id: ``string``
        :param data: the new document to insert
        :type data: ``string``

        :return: id of replaced document
        :rtype: ``dict``