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

Add support for save/update with nested paths #10

Merged
merged 1 commit into from
Mar 7, 2023
Merged

Add support for save/update with nested paths #10

merged 1 commit into from
Mar 7, 2023

Conversation

EmilianoBruni
Copy link
Collaborator

Patch to save/update documents with nested paths like

{ _id: '....', nested: {key1: val1, key2: val2, ...} ...

Works for whatever depth in path like

... nested: { nested1: { nested2 : { key1: val1 } } } ...

To save/update use ...nested.key1=newVal1&nested.key2=newVal2... or ...nested.nested1.nested2.key1=newVal1... in POST/PUT.

I was not able to create a test because tests for current module fails for this problem which I don't know how to solve (sorry I'm new to npm/nodejs)

@jeka-kiselyov jeka-kiselyov merged commit 3bb177e into jeka-kiselyov:master Mar 7, 2023
@jeka-kiselyov
Copy link
Owner

Thank you for it @EmilianoBruni

I am not very active here, personal things, sorry for being slow. But merged now.

@jeka-kiselyov
Copy link
Owner

Will try to cover it with tests and publish on npm soon

@jeka-kiselyov
Copy link
Owner

Covered with https://github.com/jeka-kiselyov/fastify-mongoose-api/blob/master/test/nested_paths.test.js and published as 1.2.18

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

2 participants