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

feat: pathsToSave option to save() function #14385

Merged
merged 10 commits into from Mar 20, 2024
Merged

Conversation

IslandRhythms
Copy link
Collaborator

closes #9583

lib/model.js Outdated Show resolved Hide resolved
Copy link

@FFUV FFUV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add some more test cases that cover:

  1. Single nested subdocs. What happens if I do save({ pathsToSave: ['subdoc.name'] }) and save({ pathsToSave: ['subdoc'] }) where we have subdoc: Schema({ name: String })? Make sure to cover both cases where name is modified like doc.subdoc.name = 'foo' as well as doc.subdoc = { name: 'bar' }
  2. Doc arrays using the same cases as above

test/model.test.js Show resolved Hide resolved
lib/document.js Outdated Show resolved Hide resolved
@vkarpov15 vkarpov15 added this to the 8.3 milestone Mar 20, 2024
@vkarpov15 vkarpov15 merged commit 276765d into 8.3 Mar 20, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants