resourceful redis engine
resourceful-redis is based on all the other resourceful engines including the standard couchdb and memory engines. Also inspired by the following projects:
resourceful-redis is just getting started. I wouldn't use it in production yet but try it out and if you find bugs create an issue so we can get it to a production ready state soon.
var redisConnection = rediscreateClient; // an external redis connectionvar resourceful = require'../lib/resourceful-redis';var Creature = resourcefuldefine'creature'// Specify redis engine and connectionthisuse"redis"// You can pass in a connection object which is recommened or// a uri string to create a connection per modelconnection: redisConnection // Pass in a redis connection// uri: "redis://DB:Pass@127.0.0.1:6379", // Set connection string here, auth is optionalnamespace: "<KEY TO USE AS NAMESPACE>" // Each model will have a different namespace to use as a key;// Specify some propertiesthisstring'diet';thisbool'vertebrate';thisarray'belly';thistimestamps;;thisbellypushfood;;
Currently resourceful-redis should support all of the CRUD methods that resourceful defines as well as simple find's and filters. In the future I would like to implement relationship modeling and hooks for redis pub/sub functionality.
$ [sudo] npm install resourceful-redis
$ npm test