Skip to content

Setters property of schema types not available in TS declarations #14879

@shawnmcknight

Description

@shawnmcknight

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Mongoose version

8.6.1

Node.js version

20.13.1

MongoDB server version

7.0.8

Typescript version (if applicable)

5.5.2

Description

In #13538 , a new static setters property was added to several schema type classes as well as an instance setters property to the base SchemaType class. These properties are not available in the TS declaration files, so accessing the setters property is issuing a type error.

image

Steps to Reproduce

mongoose.Schema.Types.String.setters.push((val?: unknown) => val);

Type error will occur on the access of the missing setters property.

Expected Behavior

The setters property should allow pushing a setter function without type error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions