hmset method

Future<bool> hmset(
  1. String key,
  2. Map<String, String> keysAndValues
)

Sets the specified fields to their respective values in the hash stored at key. This command overwrites any specified fields already existing in the hash. If key does not exist, a new key holding a hash is created.

True, if the operation was successful.

Implementation

Future<bool> hmset(String key, Map<String, String> keysAndValues) async {
  final params = <String>[];
  keysAndValues.forEach((k, v) {
    params.add(k);
    params.add(v);
  });

  final result = _getSimpleString(await _execCmd(['HMSET', key, ...params]));
  return result == 'OK';
}