Skip to content

Allow schema as a schema path name #8798

@songguangyu

Description

@songguangyu

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
When i set schema name schema,
image

mongoose throw err
image

mongoose/lib/schema.js line 528

image

If the current behavior is a bug, please provide the steps to reproduce.

const schema = new Schema({ 'schema': { type: String, default: '{}'}, });
What is the expected behavior?
I can set name schema in Schema
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Mongoose version 5.4.7
5.9.9 alse have this problem
https://github.com/Automattic/mongoose/blob/master/lib/schema.js#L645
Nodejs version 12

Metadata

Metadata

Assignees

Labels

enhancementThis issue is a user-facing general improvement that doesn't fix a bug or add a new feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions