function Model() { this.db = new MongoDB(); }; function MongoDB() { //... }; MongoDB.prototype.push = function() { console.log('push to mongoDB'); }; var model = new Model(); model.db.push();