Skip to content

Conversation

vkarpov15
Copy link
Collaborator

Summary

Make $conditionalHandlers public to allow adding custom conditional handlers

Examples

@vkarpov15 vkarpov15 added this to the 8.17 milestone Jun 29, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR makes the internal $conditionalHandlers property public on various schema types by exposing it via Object.defineProperty with appropriate documentation. Key changes include updating lib/schemaType.js to add a public API description and applying the same change consistently across multiple schema-specific files.

Reviewed Changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/schemaType.js Added a doc comment and exposed $conditionalHandlers publicly
lib/schema/uuid.js Added the public API documentation for $conditionalHandlers
lib/schema/subdocument.js Replaced internal $conditionalHandlers use with a defined public version
lib/schema/string.js Added public documentation and exposed $conditionalHandlers
lib/schema/objectId.js Added public documentation for the $conditionalHandlers property
lib/schema/number.js Exposed $conditionalHandlers publicly with an API comment
lib/schema/int32.js Added public API documentation and exposure for $conditionalHandlers
lib/schema/double.js Exposed $conditionalHandlers publicly with documentation
lib/schema/documentArray.js Updated to expose $conditionalHandlers publicly with a descriptive comment
lib/schema/decimal128.js Added public documentation and exposure for $conditionalHandlers
lib/schema/date.js Exposed $conditionalHandlers publicly with an API doc comment
lib/schema/buffer.js Added public documentation and exposure for $conditionalHandlers
lib/schema/boolean.js Exposed $conditionalHandlers publicly with a descriptive comment
lib/schema/bigint.js Added public API documentation and exposure for $conditionalHandlers
lib/schema/array.js Exposed $conditionalHandlers publicly with accompanying documentation

@hasezoey hasezoey added the docs This issue is due to a mistake or omission in the mongoosejs.com documentation label Jun 30, 2025
@vkarpov15 vkarpov15 changed the base branch from master to 8.17 July 1, 2025 16:04
@vkarpov15 vkarpov15 merged commit 1fe7cf6 into 8.17 Jul 1, 2025
77 checks passed
@hasezoey hasezoey deleted the vkarpov15/public-conditionalhandlers branch July 1, 2025 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants