Redis Documentation

Extensions on RedisClient

Methods

get(_:​as​JSON:​)

public func get<D>(_ key: RedisKey, asJSON type: D.Type) -> EventLoopFuture<D?>
        where D: Decodable

Gets the provided key as a decodable type.

set(_:​to​JSON:​)

public func set<E>(_ key: RedisKey, toJSON entity: E) -> EventLoopFuture<Void>
        where E: Encodable

Sets key to an encodable item.

setex(_:​to​JSON:​expiration​InSeconds:​)

public func setex<E>(_ key: RedisKey, toJSON entity: E, expirationInSeconds expiration: Int) -> EventLoopFuture<Void>
        where E: Encodable

Sets key to an encodable item with an expiration time.