Skip to content

Commit

Permalink
Merge pull request #15232 from Automattic/vkarpov15/gh-15208
Browse files Browse the repository at this point in the history
docs(document): clarify that toObject() returns a POJO that may contain non-POJO values
  • Loading branch information
vkarpov15 authored Feb 4, 2025
2 parents 8cfc517 + 9339bcd commit 52f3ced
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -4069,7 +4069,7 @@ Document.prototype.$__toObjectShallow = function $__toObjectShallow() {
* @param {Boolean} [options.flattenMaps=false] if true, convert Maps to POJOs. Useful if you want to `JSON.stringify()` the result of `toObject()`.
* @param {Boolean} [options.flattenObjectIds=false] if true, convert any ObjectIds in the result to 24 character hex strings.
* @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.
* @return {Object} js object (not a POJO)
* @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.
* @see mongodb.Binary https://mongodb.github.io/node-mongodb-native/4.9/classes/Binary.html
* @api public
* @memberOf Document
Expand Down

0 comments on commit 52f3ced

Please sign in to comment.