我正在使用node-redis客户端,并且我试图从我的数据库中检索一个值,然后在回调之外使用它,如下所示:
var dbValue = 0;
client.get("myKey", function(err, reply){
dbValue = reply;
});
console.log(dbValue) //Right now, this would print 0, though it needs to print the value from the database
在价值更新之前,如何进行阻止?