hset method

  1. @override
Future<int> hset(
  1. String key,
  2. String field,
  3. String value
)
override

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 ValkeyServerException if the key holds a non-hash value.

Implementation

@override
Future<int> hset(String key, String field, String value) async {
  final response = await execute(['HSET', key, field, value]);
  // Returns an Integer (:)
  return response as int;
}