lib/command/hash.js
function hsetnx(key, field, value, req) {
  var val = this.getKey(key, req)
    , exists = this.hexists(key, field, req);
  if(!val) {
    val = new HashMap();
    this.setKey(key, val, undefined, undefined, undefined, req);
  }
  if(!exists) {
    // set on the hashmap
    val.setKey(field, value);
  }
  return exists ? 0 : 1;
}
function hsetnx(key, field, value, req) {
  var val = this.getKey(key, req)
    , exists = this.hexists(key, field, req);
  if(!val) {
    val = new HashMap();
    this.setKey(key, val, undefined, undefined, undefined, req);
  }
  if(!exists) {
    // set on the hashmap
    val.setKey(field, value);
  }
  return exists ? 0 : 1;
}
function hsetnx ( key , field , value , req ) { var val = this . getKey ( key , req ) , exists = this . hexists ( key , field , req ) ; if ( ! val ) { val = new HashMap ( ) ; this . setKey ( key , val , undefined , undefined , undefined , req ) ; } if ( ! exists ) { // set on the hashmap val . setKey ( field , value ) ; } return exists ? 0 : 1 ; }
Sets field in the hash stored at key to value, only
if field does not yet exist.
Sets field in the hash stored at key to value only if field does not yet exist .