Skip to content

Schema.Types.Mixed minimize: false not working #15177

Closed as not planned
Closed as not planned
@rreeves8

Description

@rreeves8

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.9.4

Node.js version

20

MongoDB server version

8.0.4

Typescript version (if applicable)

No response

Description

I have an object, which contains nested objects, with an unknown structure. I do not want these nested objects minimized, however using minimize: false is not working.

export const TemplateSchema = new Schema(
  {
    Resources: { type: Schema.Types.Mixed, required: true },
  },
  { minimize: false, _id: false, strict: false }
);

Steps to Reproduce

Create a mixed schema.

Save an object, with nested empty objects, with minimize: false, and it will still get minimized.

Expected Behavior

Nested objects should not be minimized.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalecan't reproduceMongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.has repro scriptThere is a repro script, the Mongoose devs need to confirm that it reproduces the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions