1. function object() {
  2.  
  3. this.myProp1 = null;
  4. this.myProp2 = null;
  5.  
  6. this.myProp3 = getProp3Calculation(); //from global calculation
  7.  
  8. this.init = function([params], callback){
  9.     var that = this;      
  10.  
  11.  
  12.     var data = loadData(params);
  13.  
  14.     var model = [Mongoose Schema];
  15.     model.findOne({name: value}, function (error, document) {
  16.         if (!error && document){
  17.             callback(document, 'Success');
  18.         }
  19.         else{
  20.             callback(null, 'Error retrieving document from DB');
  21.     }
  22.     });
  23.  
  24.     //if asynchronous the following code will go into your loadCompletedHandler
  25.     //but be sure to reference "that" instead of "this" as "this" will have changed
  26.     that.myProp1 = data.Prop1;
  27.     that.myProp2 = data.Prop2;
  28.  
  29. };
  30.  
  31. [more functions and props for the object]
  32.  
  33. }