RedisJSON Explained
Vložit
- čas přidán 11. 08. 2021
- Are you longing to store nested JSON in a Redis Database? Do you want to SET and GET values without the hassle of deserialization? Store and efficiently manipulate JSON in Redis! Join Justin for a quick dive into the RedisJSON module.
Links:
Redis University → university.redis.com/
Redis Labs → www.redis.com/
RedisJSON Documentation → oss.redis.com/redisjson/
Need a Redis cluster now? Sign up for a free Redis Cloud Essentials account → bit.ly/2wasiCa
Join our discord server → / discord - Věda a technologie
Love the 106 and dx7 in the background!
it's nice to see that many people who involved in programming are musicians the same time. JUNO, Redis mine toys too
I was thinking about storing values in a Redis Stream or Timeseries and creating a client to interpret the stream as a MIDI sequence to output to my synthesizers... could be fun! - Justin
Incredible explanation!
Very well explained, I needed this, thank you!
Glad it was helpful!
Good video. I noticed the pattern through out your videos, where the keys have a colon patttern for id. I work at the edge using redis, and a few years ago i developed a three structured registry, that had a query language to find keys. Sort of like ETCD with a query language. I was wondering if any one addressed this problem.
Although, i work at the edge this may be important for Redis Labs at the cloud. The object registry could contain an entire collection of all the edge nodes objects or keys. The keys would be unique. Instead of the edge devices connecting to the cloud server, the cloud software could control the device through the redis dbs at the edge.
A better solution would be for the cloud redis db would agregate the edge device data. Control at the cloud would be done through changes at the cloud redis db. This feature could be a feature offered by the enterprise version.
Just curious what others thouh about these approaches. Thank you.
Redis Stack adds a powerful search and secondary indexing system over data stored in Hashes and JSON documents in Redis, allowing more SQL like queries. Here's a video overview of the search capability czcams.com/video/infTV4ifNZY/video.html. Redis OM clients use client side generated ULID IDs to create guaranteed unique IDs without having to request them from the server. These clients are optimized for search and JSON use cases redis.com/blog/introducing-redis-om-client-libraries/
How can i update multiple key of object in one command ?
Example: I have obj person {name: 'test',age:23,city:'Ha Noi City'}, how can i update name and age in one command ? Thank you very much.
Hey.. Good explanation about RedisJSON. I would like to know if there is any way to change the price of an existing menu item in the array.
Thanks, Himagiri!
You can directly chnage the price of an existing menu item by setting a new value.
Example changing price of burrito: JSON.SET vendor:96 menu[0].price 12.5
You can also use the NUMINCRBY command documented here:
oss.redis.com/redisjson/commands/#jsonnumincrby
Example increasing price by 1 dollar with NUMINCRBY:
JSON.NUMINCRBY vendor:96 menu[0].price 1
Hope this helps! - Justin
How to store encrypted json in redis using json_set redisjson in spring boot?
is there a way to prevent inserting duplicates by a json field? something like hsetnx do with the key
Hi Santiago! There IS! Check out the extra options with the JSON.SET command: redis.io/commands/json.set/
🙏👍
is there a way to reference the entry from another key into an entry?
menu = {"name": "tortilla", "cost": 12}
e.g. key truck = {
"name": "burrito king",
menu: [reference to menu]
}
There's currently no key reference ability w/ RedisJSON, but that's a good idea! - Justin
is Redis database can store encrypted String using JSON SET command in spring boot?
RedisJSON is really great, the GREAT problem is that in the cloud is only available on high profile servers, so there's no way to start up and scale.
Don't be put off by the high profile managed servers. Download Docker, and then run on your computer "docker run -p 6379:6379 --name redis-redisjson redislabs/rejson:latest". Now you can connect to localhost:6379 and its a redis server with the JSON module installed. You can connect to the console to run the commands in this video with "docker exec -it redis-redisjson redis-cli"
@@brianevans4 thank a lot!
Any target date for RedisJson 2.0 release and RediSearch 2.2 release?
Public preview coming very soon. Stay tuned!
Can we use expire EX command in JSON Module ?
Love from Pakistan
Hi Navid! You can use the EXPIRE command to set a TTL for RedisJSON objects. There is no EX option currently.
Thanks only one thing. How do you install Redis JSON?
Redis Stack is the newest release that contains JSON, Querying, Probabilistic Data Structures, TimeSeries and more. No extra installations necessary!
redis.io/docs/stack/
love Tacos Mi Ranchos at midnight
They're the best! - Justin
You did hide a 69 in there huh! vendor:96 huh huh huh
excellent tutorial. thank you. but i find tatto on right hand very distracting lol:)
none are useful if you dont have a proper library to use it with node and other languages. command line is not for production its for kids play
It's also great for explaining basic concepts! But to your point, Redis OM is the client of choice for RedisJSON and RediSearch.