falcor-ioredis
What is this?
Falcor-ioredis is a simple piece of middleware that uses the Falcor-model to sync with a JSON Graph stored in a Redis database. If references are found, redis will be queried automatically for the references.
Installation
$ npm install falcor-ioredis
'use strict'; var EXPRESS = FALCORIOREDIS = FALCORSERVER = FALCOR = EXPRESS = APP = ; APP ; var server = APP ;
How does it work?
Json Graph example:
"somethingById": "a": "foo": "bar" "b": "foo": "$type": "ref" "value": "valuesById[c]" "valuesById": "c": "foo": "baz"
The above example will be stored like this in Redis:
HSET somethingById a '{"foo":{$type:"ref","value":"valuesById[a]"}}'HSET somethingById b '{"foo":{"$type":"ref","value":"valuesById[c]"}}'HSET valuesById c '{"foo":"baz"}'
Model request for: //localhost/?paths=[["somethingById","a","foo"]]&method=get
will return: