Skip to content

Infinitely hangs inserting complex document with recursive schema #14897

@hunkydoryrepair

Description

@hunkydoryrepair

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.4.1+

Node.js version

20.x

MongoDB server version

5.x,6.x

Typescript version (if applicable)

5.4.5

Description

mongoose_test.zip

This test case demonstrates inserting a single document with a complex schema. it is actually simplified from out actual schema in use, and I've replace several subdocuments with Mixed. But I expect it is very likely due to the potential recursive nature of the schema.

Works as expected in version 8.2.2, 8.3.0 and 8.4.0.
Hangs in 8.4.1 - 8.6.3

Steps to Reproduce

build and run attached app.

Expected Behavior

inserts the document.

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