diff --git a/index.js b/index.js index 16f84d4..cf9d898 100644 --- a/index.js +++ b/index.js @@ -2,10 +2,12 @@ const mongoose = require('mongoose'); function extendSchema (Schema, definition, options) { - return new mongoose.Schema( + var toReturn = new mongoose.Schema( Object.assign({}, Schema.obj, definition), options ); + toReturn.callQueue = [].concat(Schema.callQueue); // copy hooks + return toReturn; } module.exports = extendSchema;