Skip to content

Commit

Permalink
docs(document): add missing params for toObject()
Browse files Browse the repository at this point in the history
Re: #6637
  • Loading branch information
vkarpov15 committed Jul 28, 2018
1 parent b0e1c5b commit 0ca947e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/document.js
Expand Up @@ -2362,8 +2362,8 @@ Document.prototype.$toObject = function(options, json) {
*
* ####Options:
*
* - `getters` apply all getters (path and virtual getters)
* - `virtuals` apply virtual getters (can override `getters` option)
* - `getters` apply all getters (path and virtual getters), defaults to false
* - `virtuals` apply virtual getters (can override `getters` option), defaults to false
* - `minimize` remove empty objects (defaults to true)
* - `transform` a transform function to apply to the resulting document before returning
* - `depopulate` depopulate any populated paths, replacing them with their original refs (defaults to false)
Expand Down Expand Up @@ -2466,6 +2466,12 @@ Document.prototype.$toObject = function(options, json) {
* _During save, no custom options are applied to the document before being sent to the database._
*
* @param {Object} [options]
* @param {Boolean} [options.getters=false] if true, apply all getters, including virtuals
* @param {Boolean} [options.virtuals=false] if true, apply virtuals. Use `{ getters: true, virtuals: false }` to just apply getters, not virtuals
* @param {Boolean} [options.minimize=true] if true, omit any empty objects from the output
* @param {Function|null} [options.transform=null] if set, mongoose will call this function to allow you to transform the returned object
* @param {Boolean} [options.depopulate=false] if true, replace any conventionally populated paths with the original id in the output. Has no affect on virtual populated paths.
* @param {Boolean} [options.versionKey=true] if false, exclude the version key (`__v` by default) from the output
* @return {Object} js object
* @see mongodb.Binary http://mongodb.github.com/node-mongodb-native/api-bson-generated/binary.html
* @api public
Expand Down

0 comments on commit 0ca947e

Please sign in to comment.