1.1.2 • Published 2 years ago

seneca-redis-store-v2 v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Seneca

A Seneca.js data storage plugin

seneca-redis-store-v2

npm version Build Status Coveralls Dependency Status Gitter

Description

A storage engine that uses redis to persist data.

seneca-redis-store's source can be read in an annotated fashion by,

  • running npm run annotate
  • viewing online.

The annotated source can be found locally at ./doc/redis-store.html.

If you're using this module, and need help, you can:

If you are new to Seneca in general, please take a look at senecajs.org. We have everything from tutorials to sample apps to help get you up and running quickly.

Seneca compatibility

Supports Seneca versions 1.x - 3.x

Supported functionality

All Seneca data store supported functionality is implemented in seneca-store-test as a test suite. The tests represent the store functionality specifications.

Install

To install, simply use npm. Remember you will need to install Seneca.js if you haven't already.

npm install seneca
npm install seneca-entity
npm install seneca-redis-store-v2

You also need redis running locally. Please visit redis for more info about how to install and run redis

Quick Example

String Uri

var seneca = require("seneca")()
var opts = {
  'uri': 'redis://user:pass@host:port'
}

String Uri with Redis Options

var seneca = require("seneca")()
var opts = {
  uri: 'redis://user:pass@host:port',
  options: {...}
}

seneca.use("entity");
seneca.use('redis-store-v2', opts);


seneca.ready(function() {
  var apple = seneca.make$('fruit')
  apple.name = 'Pink Lady'
  apple.price = 0.99
  apple.save$(function (err, apple) {
    console.log("apple.id = " + apple.id)
  })
})

See the full list of available Redis options.

Usage

You don't use this module directly. It provides an underlying data storage engine for the Seneca entity API:

var entity = seneca.make$('typename')
entity.someproperty = "something"
entity.anotherproperty = 100

entity.save$(function (err, entity) { ... })
entity.load$({id: ... }, function (err, entity) { ... })
entity.list$({property: ... }, function (err, entity) { ... })
entity.remove$({id: ... }, function (err, entity) { ... })

Contributing

The Senecajs org encourage open participation. If you feel you can help in any way, be it with documentation, examples, extra testing, or new features please get in touch.

Test

To run tests, simply use npm:

npm run test

License

Copyright (c) 2016, Marius Ursache and other contributors. Licensed under MIT.

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago