def hvals(self, key): result = [] if self._db.get(KEY_CODEC.encode_hash(key)) is not None: for _, db_value in self._get_db_iterator( KEY_CODEC.get_min_hash_field(key)): result.append(db_value) return result
def hvals(self, key): result = [] key_id, hash_length = self._get_hash_key_id_and_length(key) if hash_length > 0: for _, db_value in self._get_db_iterator( KEY_CODEC.get_min_hash_field(key_id)): result.append(db_value) return result
def _delete_db_hash(self, key): # there are two sets of db keys for hashes: # * hash # * hash fields with self._db.write_batch() as batch: batch.delete(KEY_CODEC.encode_hash(key)) for db_key, _ in self._get_db_iterator( KEY_CODEC.get_min_hash_field(key)): batch.delete(db_key)
def hgetall(self, key): result = [] if self._db.get(KEY_CODEC.encode_hash(key)) is not None: for db_key, db_value in self._get_db_iterator( KEY_CODEC.get_min_hash_field(key)): _, length, field_key = KEY_CODEC.decode_key(db_key) field = field_key[length:] result.append(field) result.append(db_value) return result
def hgetall(self, key): result = [] key_id, hash_length = self._get_hash_key_id_and_length(key) if hash_length > 0: for db_key, db_value in self._get_db_iterator( KEY_CODEC.get_min_hash_field(key_id)): _, length, field_key = KEY_CODEC.decode_key(db_key) field = field_key[length:] result.append(field) result.append(db_value) return result