Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass the "NOESCAPE" option? #19

Open
OmarOmeiri opened this issue Jul 28, 2021 · 0 comments
Open

How to pass the "NOESCAPE" option? #19

OmarOmeiri opened this issue Jul 28, 2021 · 0 comments

Comments

@OmarOmeiri
Copy link

OmarOmeiri commented Jul 28, 2021

I have tried so many ways to pass in the NOESCAPE otion to the json_get command. But it seems that is not supported.

const { promisify } = require('util')
const redis = require('redis')
const rejson = require('redis-rejson')

rejson(redis)


const redisClient = redis.createClient({...})

const getAsync = promisify(redisClient.json_get)

Then calling it like:

const jsonString = await getAsync(key, `NOESCAPE ${path}`);

or

const jsonString = await getAsync(key, `NOESCAPE "${path}"`);

or

const jsonString = await getAsync(key, `NOESCAPE \"${path}\"`);

or

const jsonString = await getAsync(key, `\"NOESCAPE\" ${path}`);

or

const jsonString = await getAsync(`${key} NOESCAPE`, path);

How are these commands translated to redisClient?

I read the #9 , but the answer makes no sense to me. If all this module is doing is making RedisJson's commands work, there should be support for all its commands or some kind of list of limitations that this module can't do.
The RedisJson command:
JSON.GET "key" NOESCAPE "somePath.someSubPath"

works flawlessly in the CLI.

This module is recommended by RedisJSON. But how the commands work are not clearly explained.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant