Option to change the result set
HI... i m new to postgres . when i m doing client.query("MY QUERY",function(err,rsl{}) the result is coming like rsl.fields as an araay. is there is any way i want result in rsl itself as an array(not wanted field key)
HI... thanks for reply but this is not what i want . Let me give you an example what i want exactly:
var query = client.query("SELECT name FROM users", function(err, result) { console.log(result.rows[0].name); ->gives = TOM
but instead of this i want my result in
console.log(result[0].name); ->gives = TOM
});
Hi.
I don't think this is possible (I might be wrong though). However, you could for example wrap your result callback(s) to transform the result object ...
I figured it out. Thanks for your help.