A redis client for the redis rejson module.
npm install ioredis-json
The node client for the RedisJSON module of redis. Under the hood it uses the ioredis client, and the APIs are conformed to the conventions of ioredis.
```
npm install ioredis-json
`javascript
var Rejson = require('ioredis-json');
var instance = new Rejson();
yield instance.connect()
yield instance.set('foo', '.', {
bar: {
hello: 'world'
}
});
value = yield instance.get('foo', '.');
console.log(value);
`
This modules passes all connection options directly onto ioredis, so you can just refer to its documentation for connection options.
By default, the client will connect automatically and emit a ready event when the connection is established. You can either listen to the ready event or use the rejson.connect() method, which returns a promise that resolves when connection is established.
Commands not implemented:
- JSON.DEBUGJSON.FORGET
- - use JSON.DEL insteadJSON.RESP
-
To get started, simply install the require modules via npm install.
You may run the unit tests using npm test. Make sure mocha and eslint are in your global path.
You can make a file under tests that is called redis.json` to specify your own redis credentials to use in tests.
The MIT License (MIT)
Copyright (c) 2017 Evan Huang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.