collection-adapter

Supports redis


Keywords
collection, key, value, adapter, redis
License
MIT
Install
npm install collection-adapter@0.1.2

Documentation

nodejs-collection-adapter

Build Status Test Coverage

Provides a simple interface to collection based data stores

Currently supports

Basic usage

var adapter = require('collection-adapter').create('redis');

adapter.set("my-collection", "my-key", "my-value").then(function (reply) {
    console.log("Successfully set key");
});

adapter.get("my-collection", "my-key").then(function (value) {
    console.log(value);
});

Typescript usage

var adapterFactory = require('collection-adapter');

var redisConfig = new RedisConfig();
redisConfig.port = process.env.REDIS_PORT;
redisConfig.host = process.env.REDIS_HOST;

var adapter = adapterFactory.create('redis', redisConfig);

adapter.set("my-collection", "my-key", "my-value").then(function (reply) {
    console.log("Successfully set key");
});

adapter.get("my-collection", "my-key").then(function (value) {
    console.log(value);
});