upstash_redis 1.0.2+1 copy "upstash_redis: ^1.0.2+1" to clipboard
upstash_redis: ^1.0.2+1 copied to clipboard

outdated

upstash/redis is an HTTP/REST based Redis client for dart, built on top of Upstash REST API.

example/upstash_redis_example.dart

import 'package:upstash_redis/upstash_redis.dart';

Future<void> main() async {
  final redis = Redis.fromEnv();

  print(await redis.set('name', 'rebaz', ex: 60));
  print(await redis.set(
      'obj',
      {
        'v': {
          'a': [1, 2],
          'b': [3, 4]
        }
      },
      ex: 60));
  print(await redis.get<String>('name'));
  print(await redis.get<Map<String, Map<String, List<int>>>>('obj'));
  print(await redis.set('name', 'raouf', ex: 60, nx: true));
  print(await redis.zadd('z', score: 1, member: 'rebaz'));
  print(await redis.zadd(
    'z2',
    scores: [
      ScoreMember(score: 2, member: 'Mike'),
      ScoreMember(score: 3, member: 'Ali'),
      ScoreMember(score: 4, member: 'Jack'),
    ],
  ));
  print(await redis.zrem('z2', ['Jack', 'Ali']));
}
6
likes
0
points
48
downloads

Publisher

verified publisherswiftytime.com

Weekly Downloads

upstash/redis is an HTTP/REST based Redis client for dart, built on top of Upstash REST API.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, http

More

Packages that depend on upstash_redis