—
getData()
.then(reduceData)
.then(writeDatatoRedis)
Might be the preferred way
— Separating each process so you can switch mongo or redis independently
— Any external thing is a dependency, so they should be decoupled
— While the reducing operation shouldn't know about either mongo nor redis
— Hey guys, do you know where or have a function which removes one structure from another? Some kind of Object1 - Object2 = reduced Object1
Message permanent page
— Http://ramdajs.com/docs/#omit
— Depends a bit on what you mean by subtract
— Objects have keys and values
— Seem to work on single level, need to recurse further
— Value can be antoher object