Skip to content

Commit

Permalink
populate; add doc.populated()
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Feb 3, 2013
1 parent 89cedc6 commit 89b97e0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,21 @@ Document.prototype.equals = function (doc) {
return tid.equals
? tid.equals(docid)
: tid === docid;
};
}

/**
* Returns value(s) retreived during population.
*
* If the path was not populated, undefined is returned. Otherwise, the population result is returned.
*
* @param {String} path
* @return {Array|Document|null|undefined}
*/

Document.prototype.populated = function (path) {
if (!this.$__.populated) return undefined;
return this.$__.populated[path];
}

/*!
* Module exports.
Expand Down

0 comments on commit 89b97e0

Please sign in to comment.