Skip to content

schema type object setter not working #8444

Closed
@BGOnline-CN

Description

@BGOnline-CN

I tried to do this(type: Object), but found that the setter did not take effect, This is normal when I change type to Number or String

jobCategory: {
   type: Object,
   set: v => {
     console.log(v)
     return {
        name: 1,
        value: 1
      }
   }
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugWe've confirmed this is a bug in Mongoose and will fix it.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions