divyanayan awasthi
divyanayan awasthi

Reputation: 950

Querying data on json saved using ReJSON

i have saved one json using Rejson against a key,now i would like to filter/query out data using ReJson.

Please let me know how can i do it ...python prefered .

print("Abount to execute coomnad")
    response=redisClient.execute_command('JSON.SET', 'object', '.', json.dumps(data))
    print(response)
    reply = json.loads(redisClient.execute_command('JSON.GET', 'object'))
    print(reply)

using the above code i was able to set data using ReJson .now lets suppose i want to filer data .

my test json is :

data = {
    'foo': 'bar',
    'ans': 42
}

How can you filter say json in which foo has value as bar

Upvotes: 1

Views: 1891

Answers (1)

Itamar Haber
Itamar Haber

Reputation: 49982

Redis in general, and ReJSON specifically, do not provide search-by-value functionality. For that, you'll have to either index the values yourself (see https://redis.io/topics/indexes) or use RediSearch.

Upvotes: 2

Related Questions