How do I prevent an ObjectID form becoming 开发者_StackOverflow中文版primitive when passing in and out of Redis?
Parsing to JSON string? Thanks!
You can either store your object as JSON string representation in simple string or use hash data structure. Node.js node_redis module offers friendlier hash commands which may be useful. There is also a library for storing objects in redis called nohm which is based on object-hash mapping library ohm.
精彩评论