code: async def xadd(self, name: str, entry: dict,
                     max_len=None, stream_id='*',
                     approximate=True) -> str:
          
          pieces = []
          if max_len is not None:
              if not isinstance(max_len, int) or max_len < 1:
                  raise RedisError("XADD maxlen must be a positive integer")
              pieces.append('MAXLEN')
              if approximate:
                  pieces.append('~')
              pieces.append(str(max_len))
          pieces.append(stream_id)
          for kv in entry.items():
              pieces.extend(list(kv))
          return await self.execute_command('XADD', name, *pieces)
docs: Appends the specified stream entry to the stream at the specified key.
          If the key does not exist, as a side effect of running
          this command the key is created with a stream value.
          Available since 5.0.0.
          Time complexity: O(log(N)) with N being the number of items already into the stream.
  
          :param name: name of the stream
          :param entry: key-values to be appended to the stream
          :param max_len: max length of the stream
          length will not be limited max_len is set to None
          notice: max_len should be int greater than 0,
          if set to 0 or negative, the stream length will not be limited
  
          :param stream_id: id of the options appended to the stream.
          The XADD command will auto-generate a unique id for you
          if the id argument specified is the * character.
          ID are specified by two numbers separated by a "-" character
  
          :param approximate: whether redis will limit
          the stream with given max length exactly, if set to True,
          there will be a few tens of entries more,
          but never less than 1000 items
  
          :return: id auto generated or the specified id given.
          notice: specified id without "-" character will be completed like "id-0"