model-redis-sync

0.0.1 • Public • Published

model-redis-sync

redis sync adaptor for use with node-model.

Installation

npm install model-redis-sync

Example

var model = require('node-model')
var redisOptions = {
  host: '...',
  port: '...'
}
var redisSync = require('model-redis-sync')(redisOptions)
 
var Post = model('Post')
  .attr('id')
  .attr('title')
  .attr('body')
 
Post.sync = redisSync
 
var post = new Post({title: "My Awesome Post", body: "Is awesome"})
post.save(function(err) {
  ...
})

modelName is used to determine the redis key. In this case it will be Post:uuid

Tests

npm test

Readme

Keywords

none

Package Sidebar

Install

npm i model-redis-sync

Weekly Downloads

3

Version

0.0.1

License

MIT

Last publish

Collaborators

  • stereosteve