I am new to redis, at the moment using the redis client npm package to interact with it. I have a function which attempts to return a value from redis like so:
The key/val pair is like : foo/true
function getVal(key: string, field: string) {
    // updates value for that field
        return client.hget(key, field, function (hashGetError: any, result: any) {
            if (hashGetError) {
                // do something
            } else {
                return new Promise((resolve) => {
                    console.log("fetch result is: " + result); << here I can see a value i.e "true"
                    resolve(result);
                })
            }
    
        });
}
the calling code looks like this
let bar = getVal("key", "foo");
console.log(bar); << this is always returning false?
Any pointers are appreciated :)
