Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create field '-1' in element (mongoose 5.11.15) #9909

Closed
gask opened this issue Feb 9, 2021 · 0 comments
Closed

Cannot create field '-1' in element (mongoose 5.11.15) #9909

gask opened this issue Feb 9, 2021 · 0 comments
Labels
confirmed-bug We've confirmed this is a bug in Mongoose and will fix it.
Milestone

Comments

@gask
Copy link

gask commented Feb 9, 2021

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

What is the current behavior?
I'm trying to save an object that was obtained by the function findOne using .select()after adding an element to an array field and it gives me the error in the title. This doesn't happen in version 5.8.7, but in 5.10.15 it started happening. I tested also in the latest version 5.11.15 and it still is happening.

If the current behavior is a bug, please provide the steps to reproduce.
https://gist.github.com/gask/cb1d3dfa25b31d3ef0a406a2a12724a0

What is the expected behavior?
Saving normally.

What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
NPM 6.12.0
Node 12.13.0
Mongoose 5.10.15 (tested also in 5.11.15)
MongoDB 4.4

@gask gask changed the title Cannot create field '-1' in element (mongoose 5.10.15) Cannot create field '-1' in element (mongoose 5.11.15) Feb 9, 2021
@IslandRhythms IslandRhythms added has repro script There is a repro script, the Mongoose devs need to confirm that it reproduces the issue confirmed-bug We've confirmed this is a bug in Mongoose and will fix it. labels Feb 11, 2021
@vkarpov15 vkarpov15 added this to the 5.11.17 milestone Feb 12, 2021
@vkarpov15 vkarpov15 removed the has repro script There is a repro script, the Mongoose devs need to confirm that it reproduces the issue label Feb 16, 2021
vkarpov15 added a commit that referenced this issue Feb 16, 2021
vkarpov15 added a commit that referenced this issue Feb 16, 2021
This was referenced Mar 5, 2021
This was referenced Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug We've confirmed this is a bug in Mongoose and will fix it.
Projects
None yet
Development

No branches or pull requests

3 participants