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 upsert (findOneAndUpdate) #6

Open
bwgjoseph opened this issue Sep 10, 2021 · 1 comment
Open

add support for upsert (findOneAndUpdate) #6

bwgjoseph opened this issue Sep 10, 2021 · 1 comment
Assignees

Comments

@bwgjoseph
Copy link
Owner

bwgjoseph commented Sep 10, 2021

Provide a way to take in options (e.g params.ottoman) where it allows user to specify upsert option for patch method

See findOneAndUpdate and FindOneAndUpdateOption

service.patch(null, data, { query: { name: 'hello' }, ottoman: { upsert: true, new: true } });
@bwgjoseph bwgjoseph self-assigned this Sep 10, 2021
@bwgjoseph
Copy link
Owner Author

updateMany API supports passing in UpdateManyOptions option where we can pass in through params.ottoman and process it in

_getOptions(filters: Filters, method: Methods = 'default'): Query {

Unfortunately, that would means that if params.ottoman is present, we would have to call non KV operation to update the document by using either findOneAndUpdate or updateMany

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

No branches or pull requests

1 participant