Skip to content

Example of returning results very fast as a pure integer based array

Tom Conlon edited this page Dec 11, 2015 · 3 revisions

i.e. not returning objects nor having to include their field names for each and every row

Database.prototype.queryArray = function(query, params, callback) {
   var _self = this, custom;    

   if (params instanceof Function) {
      callback = params;
      params = undefined;
   }
   custom = { asObject: false, asStream: callback === undefined || callback === null };

   _self.execute(query, params, callback, custom);
   return _self;
};