Skip to content

Commit 52f3ced

Browse files
authored
Merge pull request #15232 from Automattic/vkarpov15/gh-15208
docs(document): clarify that toObject() returns a POJO that may contain non-POJO values
2 parents 8cfc517 + 9339bcd commit 52f3ced

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/document.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4069,7 +4069,7 @@ Document.prototype.$__toObjectShallow = function $__toObjectShallow() {
40694069
* @param {Boolean} [options.flattenMaps=false] if true, convert Maps to POJOs. Useful if you want to `JSON.stringify()` the result of `toObject()`.
40704070
* @param {Boolean} [options.flattenObjectIds=false] if true, convert any ObjectIds in the result to 24 character hex strings.
40714071
* @param {Boolean} [options.useProjection=false] - If true, omits fields that are excluded in this document's projection. Unless you specified a projection, this will omit any field that has `select: false` in the schema.
4072-
* @return {Object} js object (not a POJO)
4072+
* @return {Object} document as a plain old JavaScript object (POJO). This object may contain ObjectIds, Maps, Dates, mongodb.Binary, Buffers, and other non-POJO values.
40734073
* @see mongodb.Binary https://mongodb.github.io/node-mongodb-native/4.9/classes/Binary.html
40744074
* @api public
40754075
* @memberOf Document

0 commit comments

Comments
 (0)