Questions tagged [redisjson]

117 questions
92
votes
10 answers

how to store a complex object in redis (using redis-py)

The hmset function can set the value of each field, but I found that if the value itself is a complex structured object, the value return from hget is a serialized string, not the original object e.g images= [{'type':'big', 'url':'....'}, …
yuan
  • 1,113
  • 2
  • 9
  • 10
10
votes
1 answer

Why am I getting the "ReplyError: ERR unknown command JSON.SET" with Redis?

I was trying to set JSON as value in Redis, and I am getting an error for the following code: const createClient = require('redis'); async function redisJSONDemo () { try { const TEST_KEY = 'test_node'; const client =…
vuld0
  • 184
  • 1
  • 1
  • 9
6
votes
1 answer

Redis rejson or string

I am going to use Redis to store json documents that will have nested structure. My requirement is just to set and get the documents. I have no need to perform any json specific commands on the documents. Do I get any advantage by using rejson…
pawinder gupta
  • 1,225
  • 16
  • 35
5
votes
1 answer

Redis: When to use hashes vs RedisJSON?

I'm at a point where I could store a resource in Redis as either hash or RedisJSON. My particular data in this instance is are temporary data objects consisting of several string and numeric fields each. A user will invoke a process which creates a…
xendi
  • 2,332
  • 5
  • 40
  • 64
5
votes
2 answers

ERR unknown command 'JSON.SET' - Rejson/Redis

I have followed the tutorial and run: docker run -p 6379:6379 --name redis-rejson redislabs/rejson:latest But when I try to run redis-cli and then json.get, I got: ERR unknown command 'JSON.SET' MODULE LIST return nil. Can anyone guide me on how…
Minh Anh Tran
  • 145
  • 1
  • 7
4
votes
2 answers

Storing Json object in redis for fast querying

I've been using MongoDB to store and query schema-less json documents (~10 mn records). The queries typically involve finding json documents having a matching key-value pair and run into seconds. I was looking at ways to make queries run faster and…
Kapil Earanky
  • 211
  • 4
  • 18
3
votes
1 answer

redis-py ft().search() not returning results

I'm using the following test code to experiment with RediSearch using RedisJSON data. I would expect client.ft(candles_index).search("4h") to return the JSON data in the candles list, but there are no results returned. I've been using some of the…
Jason
  • 404
  • 4
  • 14
3
votes
1 answer

Unable to load redis module, RedisJSON

After following the instructions specified here to compile the source code of RedisJson, got the rejson.so file at project_root/target/release, then I entered this command sudo redis-server --loadmodule…
Ercross
  • 519
  • 6
  • 17
3
votes
1 answer

rejson=py example not working on python 3.6

Trying to work through setting up ReJSON with Python3. I am running on Ubuntu 16.04 in windows (WSL) and have Redis and ReJSON working. Have simplified the python in the https://github.com/RedisLabs/rejson-py docs to isolate the problem: from…
GregD
  • 71
  • 4
2
votes
1 answer

How to get only specific properties for multiple keys with RedisJson MGET?

I would like to get only specific properties of multiple RedisJson objects stored in the DB. For example, 2 RedisJson were created: JSON.SET Cat:1 . '{"name":"Mitzi", "color":"pink", "age":1}' JSON.SET Cat:2 . '{"name":"Lucky", "color":"black",…
marina
  • 55
  • 4
2
votes
1 answer

How to set time to live(TTL) in Redis OM

I am using Redis OM in my spring boot application, I have set Redis configuration and TTL in application.properties, every configuration is ok but TTL is not working.I have added below dependency to use Redis OM
M.Minbashi
  • 244
  • 1
  • 3
  • 12
2
votes
1 answer

How do I find the index of a json object in an array based off of a value of its properties

I am fairly new to Redis and RedisJson and I have been through all the documentation I can get my hands on, but I still can't seem to figure this one out. I am hoping someone could shed some light on this situation to help me understand. My end goal…
BlueYonder
  • 21
  • 2
2
votes
1 answer

RedisSearch get max date in JSON

I use RedisSearch to query my products I want to get last 10 products changed In SQL I can do that with: Select top 10 * from products order by max(changedate) desc How can I get the same result using RedisSearch?
Akelmj
  • 99
  • 4
2
votes
1 answer

Lua script access object path inside an array

I'm trying to access the object with property optionId = 'a386ead3-08ca-486e-aeb1-23add87292e7' to set its weight. my object is like following: weight": { "options": [ { "optionId":…
Mohammed Ehab
  • 207
  • 1
  • 5
  • 14
2
votes
1 answer

Redisearch unable to search nested JSON array

I am experimenting with use redis-search + redis-json. But facing problem querying on Nested Json with array. I created following JSON { "src":{ "location":[ { "ref":"/uuid/1/xyz", "key":"zone" }, …
1
2 3 4 5 6 7 8