From 0ca947e78acecc73079009f765328c19f18846c0 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Sat, 28 Jul 2018 14:48:09 -0400 Subject: [PATCH] docs(document): add missing params for `toObject()` Re: #6637 --- lib/document.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/document.js b/lib/document.js index ff6b49099b1..b11febf2699 100644 --- a/lib/document.js +++ b/lib/document.js @@ -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) @@ -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