ys-dbo-redis

yishu database engine for redis, both of common and cluster.

Usage no npm install needed!

<script type="module">
  import ysDboRedis from 'https://cdn.skypack.dev/ys-dbo-redis';
</script>

README

ys-dbo-mysql

ys-dbo的插件之redis数据处理。

Install

npm i ys-dbo-reids --save

Usage

const DBO = require('ys-dbo');
const mysql = require('ys-dbo-redis');
const dbo = new DBO([
  new DBO_REDIS({
    host     : '',
    password : '',
    port     : 6379,
    keepAlive: 0
  })
])

注意:我们用way表示线程对像,之后类同

Code

await way.redis.begin();
await way.redis.hmset('a', { a: 1});
await way.redis.set('b', 'test'); // data: array or json
await way.redis.get('b');
await way.redis.hgetall('a');
await way.redis.commit();
await way.redis.rollback();

License

It is MIT licensed.