Skip to content

Commit

Permalink
docs(document): improve $assertPopulated() docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Aug 30, 2022
1 parent d87e627 commit 1563a1b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -4417,8 +4417,13 @@ Document.prototype.$populated = Document.prototype.populated;
* doc.$assertPopulated('author'); // does not throw
* doc.$assertPopulated('other path'); // throws an error
*
* // Manually populate and assert in one call. The following does
* // `doc.$set({ likes })` before asserting.
* doc.$assertPopulated('likes', { likes });
*
* @param {String|String[]} path
*
* @param {String|String[]} path path or array of paths to check. `$assertPopulated` throws if any of the given paths is not populated.
* @param {Object} [values] optional values to `$set()`. Convenient if you want to manually populate a path and assert that the path was populated in 1 call.
* @return {Document} this
* @memberOf Document
* @method $assertPopulated
Expand Down

0 comments on commit 1563a1b

Please sign in to comment.