需求是通过redis做一个缓存services
但是在config/connections.js下配置的数据库似乎只能用于orm
不知道有没有现成的方案可以直接操作redis数据库
=======================
分享一下node原生redis库操作
# 创建连接
redis = require('redis').createClient()
# 监听异常
redis.on 'error', (err) ->
console.log(err)
# 记录值
redis.set(key, value)
# 读取值
redis.get key, (err, data) ->
There is no ORM tool similar to DB for redis, but Spring has encapsulation of Redis, you can understand it
Print out
expressed that he also wanted to know, because the ORM has a
query
method, but it is used to execute sql. And after playing with the entire waterline package, the operation feels very similar to the mongo document type nosql. Redis cannot perform low-level operations.Another question is whether sails supports multiple data sources at the same time