redis-collections/simple-example

node v6.17.1
version: 1.0.0
endpointsharetweet
// this example uses fakeredis instead of redis const redis = require('fakeredis') // load the store and the collection we will use const {Store, RedisSet} = require("redis-collections") // create a store to run the queries const store = new Store(redis.createClient()) // define a set. it will be stored under the key 'numbers' const numbers = new RedisSet('numbers') // add 'two' to the set await store.promise(numbers.add('two')) // add 'one' to the set await store.promise(numbers.add('one')) // load the set into a list const list = await store.promise(numbers.getList()) // print the list return list
Loading…

no comments

    sign in to comment