Wednesday, 13 February 2019

Frustrating async/await resolving

Hi redit, I am using redis npm, and I am trying to do a function that uses keys function in the package and returning all keys with some kind of pattern.This is my code:(i have a connection already.)const getKeysWithPattern = async (pattern) => { redisClient.keys(pattern, (err, keys) => if (err) return err return keys; });Well the problem is that when I call this function I cannot access to those keys !I tried alot of stuff that i cant even remmber (I used await alot).Anyone that can help a js promises beginner ill thank him (-:

Submitted February 13, 2019 at 07:39PM by noobbun

No comments:

Post a Comment