Skip to content

Commit 0ca947e

Browse files
committedJul 28, 2018
docs(document): add missing params for toObject()
Re: #6637
1 parent b0e1c5b commit 0ca947e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎lib/document.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -2362,8 +2362,8 @@ Document.prototype.$toObject = function(options, json) {
23622362
*
23632363
* ####Options:
23642364
*
2365-
* - `getters` apply all getters (path and virtual getters)
2366-
* - `virtuals` apply virtual getters (can override `getters` option)
2365+
* - `getters` apply all getters (path and virtual getters), defaults to false
2366+
* - `virtuals` apply virtual getters (can override `getters` option), defaults to false
23672367
* - `minimize` remove empty objects (defaults to true)
23682368
* - `transform` a transform function to apply to the resulting document before returning
23692369
* - `depopulate` depopulate any populated paths, replacing them with their original refs (defaults to false)
@@ -2466,6 +2466,12 @@ Document.prototype.$toObject = function(options, json) {
24662466
* _During save, no custom options are applied to the document before being sent to the database._
24672467
*
24682468
* @param {Object} [options]
2469+
* @param {Boolean} [options.getters=false] if true, apply all getters, including virtuals
2470+
* @param {Boolean} [options.virtuals=false] if true, apply virtuals. Use `{ getters: true, virtuals: false }` to just apply getters, not virtuals
2471+
* @param {Boolean} [options.minimize=true] if true, omit any empty objects from the output
2472+
* @param {Function|null} [options.transform=null] if set, mongoose will call this function to allow you to transform the returned object
2473+
* @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.
2474+
* @param {Boolean} [options.versionKey=true] if false, exclude the version key (`__v` by default) from the output
24692475
* @return {Object} js object
24702476
* @see mongodb.Binary http://mongodb.github.com/node-mongodb-native/api-bson-generated/binary.html
24712477
* @api public

0 commit comments

Comments
 (0)
Please sign in to comment.