by est · 10y ago · 0 comments
db.hello = {world: ["foo", "bar"]};
vs db.set("hello", JSON.stringify(
{world: ["foo", "bar"]}))
Why we don't have macros already.Anyway, yeah, it's just meant to be some sort of synchronous syntactic sugar on Redis.
Edit: I think you meant macros. In that case, consider that it's not as simple as that, because a) the redis library is only asynchronous, and b) such an approach requires to implement wrappers for every function that writes to the object, eg. Array.proto.splice.
var world = db.hello.world;
world.push("baz");Probably not the best use of it though.