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

Single nested document set function is being calling twice #7196

Closed
LucGranato opened this issue Oct 29, 2018 · 1 comment
Closed

Single nested document set function is being calling twice #7196

LucGranato opened this issue Oct 29, 2018 · 1 comment
Labels
confirmed-bug We've confirmed this is a bug in Mongoose and will fix it.
Milestone

Comments

@LucGranato
Copy link
Contributor

LucGranato commented Oct 29, 2018

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

What is the current behavior?
When setting a value to a single nested document field

rootDoc.set('anything.subDoc.someField', 12);

The set function is called twice

{
  ...
  someField: {
    set: function(value) {
      return value;
    }
  }
  ...
}

The first time with this as rootDoc and the second as subDoc.

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

What is the expected behavior?
Calling only one time.

Please mention your node.js, mongoose and MongoDB version.
node: 8.11.3
mongoose: 5.3.7

@vkarpov15 vkarpov15 added this to the 5.3.10 milestone Nov 2, 2018
@vkarpov15 vkarpov15 added the confirmed-bug We've confirmed this is a bug in Mongoose and will fix it. label Nov 2, 2018
@vkarpov15 vkarpov15 modified the milestones: 5.3.10, 5.3.9 Nov 2, 2018
@vkarpov15
Copy link
Collaborator

Thanks for reporting, will fix asap

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

2 participants