当前位置:网站首页>Ubuntu20 installation redisjson record

Ubuntu20 installation redisjson record

2022-07-07 03:25:00 Xiaojunjun's blog

ubuntu20 install redisjson Record

One 、 Download the file

https://github.com/RedisJSON/RedisJSON/releases
find 1.0.4 edition , download rejson.so
 Insert picture description here

Two 、 Copy files to the specified folder

sudo cp ./src/rejson.so /usr/lib/

./src/rejson.so Download for you rejson.so Folder .

3、 ... and 、 Modify the configuration file

sudo gedit /etc/redis/redis.conf

In the 40 Add a few lines or so

loadmodule /usr/lib/rejson.so

 Insert picture description here
restart redis

sudo systemctl restart redis

Four 、 test

Turn on redis

redis-cli

Input

json.set  abc . '{"a":"1","b":"2","c":"3"}'

If you return ok that will do
 Insert picture description here

5、 ... and 、 Add

1. stay redisjson in ,json Stored format problem escape character
 Insert picture description here
stay redisjson Enter the command json.get when , You can see that the storage format changes a little , This is reflected in C++ In the code , The input data format also needs to be adjusted accordingly . Pay attention to the application of escape characters , Here's the picture :
 Insert picture description here

原网站

版权声明
本文为[Xiaojunjun's blog]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207062019497812.html