lib/command/connection/select.js
function execute(req, res) {

  // if we have a sparse db store we need
  // to ensure a database exists
  if(!this.store.databases[req.args[0]]) {
    this.store.getDatabase(req.args[0], {pattern: this.pattern});
  }

  // update the connection with their selected db index
  req.conn.db = req.args[0];

  res.send(null, Constants.OK);
}
function execute(req, res) {

  // if we have a sparse db store we need
  // to ensure a database exists
  if(!this.store.databases[req.args[0]]) {
    this.store.getDatabase(req.args[0], {pattern: this.pattern});
  }

  // update the connection with their selected db index
  req.conn.db = req.args[0];

  res.send(null, Constants.OK);
}
function execute ( req , res ) { // if we have a sparse db store we need // to ensure a database exists if ( ! this . store . databases [ req . args [ 0 ] ] ) { this . store . getDatabase ( req . args [ 0 ] , { pattern : this . pattern } ) ; } // update the connection with their selected db index req . conn . db = req . args [ 0 ] ; res . send ( null , Constants . OK ) ; }
Respond to the SELECT command.
Respond to the SELECT command .