hSet abstract method

Future<int> hSet(
  1. String key,
  2. Map<String, String> data
)

Sets field in the hash stored at key to value.

Returns 1 if field is a new field and was set, or 0 if field already existed and was updated. Throws a TRServerException if the key holds a non-hash value.

Adds a field-value pair to the hash stored at key. Returns the number of fields that were added. Usage:

await hSet('user:2', {'name':'john', 'age':'20'});
await hSet('user:2', {'name':'john'});

Implementation

Future<int> hSet(String key, Map<String, String> data);