Node.js & Redis / hget synchronize
<p>I wish to create a synchronize command of hget in node.js. </p>

<p>I wrote the following:</p>

<pre><code>var db = require("redis");
var dbclient = db.createClient();
var res1 = dbclient.hget("all_records", "/" + full_path)
if (res1 != undefined){
    objStatus.status = "TRUE"
 } else {
     objStatus.status = "FALSE"
 }
</code></pre>

<p>The problem is that in <code>res1</code>, I always gets <code>true</code>, while I set numbers to this field:</p>

<pre><code>dbclient.hset("all_records", key, size); // size is number
</code></pre>

<p>It also returns true if the key doesn't exists.</p>

<p>How can I perform this command?</p>

<p>Edit (here is the full code and why I use sync call):</p>

<pre><code>   for (var attr in paths) {
        var full_path = "/0" + attr
        var objStatus = new Object();
        var res1 = dbclient.hget("all_records", "/" + full_path)
        if (res1 != undefined){
            objStatus.status = "TRUE"
        } else {
            objStatus.status = "FALSE"
        }
     }
     arrayResult.push(objStatus);
    }
    return arrayResult;
</code></pre>