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

Does Async await works with json_get ?? #15

Open
TitusRobyK opened this issue Jan 19, 2021 · 1 comment
Open

Does Async await works with json_get ?? #15

TitusRobyK opened this issue Jan 19, 2021 · 1 comment

Comments

@TitusRobyK
Copy link

I was trying with
let response = await client.json_get(requestKey,path);
i obtaining response as false

@collin-thomas
Copy link

collin-thomas commented Mar 31, 2021

You can make it work

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

rejson(redis)
const redisClient = redis.createClient({
    host: '...',
})

// the answer to your question
const redis_jget = promisify(redisClient.json_get).bind(redisClient)

let response = await redis_jget(requestKey, path)

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

2 participants