diff --git a/lib/model.js b/lib/model.js index c8c9f3e961c..b95f4ad3bf2 100644 --- a/lib/model.js +++ b/lib/model.js @@ -1067,6 +1067,7 @@ Model.exists = function exists(filter, options, callback) { * @param {String} name discriminator model name * @param {Schema} schema discriminator model schema * @param {String} [value] the string stored in the `discriminatorKey` property. If not specified, Mongoose uses the `name` parameter. + * @return {Model} The newly created discriminator model * @api public */ @@ -3411,7 +3412,7 @@ Model.bulkWrite = function(ops, options, callback) { * var mongooseCandy = Candy.hydrate({ _id: '54108337212ffb6d459f854c', type: 'jelly bean' }); * * @param {Object} obj - * @return {Model} document instance + * @return {Document} document instance * @api public */ diff --git a/lib/queryhelpers.js b/lib/queryhelpers.js index 10bfd9bd777..045354f0f84 100644 --- a/lib/queryhelpers.js +++ b/lib/queryhelpers.js @@ -107,7 +107,7 @@ exports.getDiscriminatorByValue = getDiscriminatorByValue; * @param {Object} doc * @param {Object} fields * - * @return {Model} + * @return {Document} */ exports.createModel = function createModel(model, doc, fields, userProvidedFields) { model.hooks.execPreSync('createModel', doc); diff --git a/lib/schema/SingleNestedPath.js b/lib/schema/SingleNestedPath.js index 00032ad793e..ec7b8df6dbb 100644 --- a/lib/schema/SingleNestedPath.js +++ b/lib/schema/SingleNestedPath.js @@ -280,6 +280,7 @@ SingleNestedPath.prototype.doValidateSync = function(value, scope, options) { * @param {String} name * @param {Schema} schema fields to add to the schema for instances of this sub-class * @param {String} [value] the string stored in the `discriminatorKey` property. If not specified, Mongoose uses the `name` parameter. + * @return {Function} the constructor Mongoose will use for creating instances of this discriminator model * @see discriminators /docs/discriminators.html * @api public */ diff --git a/lib/schema/documentarray.js b/lib/schema/documentarray.js index c39f425a86c..4f8cbb026d3 100644 --- a/lib/schema/documentarray.js +++ b/lib/schema/documentarray.js @@ -147,6 +147,7 @@ function _createConstructor(schema, options, baseClass) { * @param {Schema} schema fields to add to the schema for instances of this sub-class * @param {String} [value] the string stored in the `discriminatorKey` property. If not specified, Mongoose uses the `name` parameter. * @see discriminators /docs/discriminators.html + * @return {Function} the constructor Mongoose will use for creating instances of this discriminator model * @api public */