Skip to content

Commit 874b4f9

Browse files
committed
docs(document): add hydratedPopulatedDocs option info and other improvements to init() docs
1 parent f8c705e commit 874b4f9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/document.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,16 +624,17 @@ Document.prototype.toBSON = function() {
624624
};
625625

626626
/**
627-
* Initializes the document without setters or marking anything modified.
627+
* Hydrates this document with the data in `doc`. Does not run setters or mark any paths modified.
628628
*
629-
* Called internally after a document is returned from mongodb. Normally,
629+
* Called internally after a document is returned from MongoDB. Normally,
630630
* you do **not** need to call this function on your own.
631631
*
632632
* This function triggers `init` [middleware](https://mongoosejs.com/docs/middleware.html).
633633
* Note that `init` hooks are [synchronous](https://mongoosejs.com/docs/middleware.html#synchronous).
634634
*
635-
* @param {Object} doc document returned by mongo
635+
* @param {Object} doc raw document returned by mongo
636636
* @param {Object} [opts]
637+
* @param {Boolean} [opts.hydratedPopulatedDocs=false] If true, hydrate and mark as populated any paths that are populated in the raw document
637638
* @param {Function} [fn]
638639
* @api public
639640
* @memberOf Document

0 commit comments

Comments
 (0)