@defer.inlineCallbacks
    def add_tag_to_room(self, user_id, room_id, tag, content):
        content_json = json.dumps(content)

        def add_tag_txn(txn, next_id):
            self._simple_upsert_txn(
                txn,
                table="room_tags",
                keyvalues={
                    "user_id": user_id,
                    "room_id": room_id,
                    "tag": tag,
                },
                values={
                    "content": content_json,
                }
            )
            self._update_revision_txn(txn, user_id, room_id, next_id)

        with self._account_data_id_gen.get_next() as next_id:
            yield self.runInteraction("add_tag", add_tag_txn, next_id)

        self.get_tags_for_user.invalidate((user_id,))

        result = self._account_data_id_gen.get_max_token()
        defer.returnValue(result)
Returns the entry as a JSON string.
dataset/ETHPy150Open matrix-org/synapse/synapse/storage/tags.py/TagsStore.add_tag_to_room--crossover with--dataset/ETHPy150Open guoguo12/billboard-charts/billboard.py/ChartEntry.to_JSON