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

Return type of update() is incorrect #334

Open
joewestcott opened this issue Feb 19, 2021 · 3 comments
Open

Return type of update() is incorrect #334

joewestcott opened this issue Feb 19, 2021 · 3 comments

Comments

@joewestcott
Copy link
Contributor

In the current version of Monk, v7.3.3 the return type of update() is UpdateWriteOpResult, I think it should be UpdateResult.

monk/index.d.ts

Lines 335 to 339 in 027ab43

update(
query: FilterQuery<T>,
update: UpdateQuery<T> | Partial<T>,
options?: UpdateOneOptions & { single?: true, multi?: false, replace?: false}
): Promise<UpdateWriteOpResult>;

(Same with the other update() calls, perhaps?)

@zkrising
Copy link
Contributor

zkrising commented Apr 2, 2021

Just got bit by this too. Can make a pull request if there isn't already one going?

@joewestcott
Copy link
Contributor Author

@zkldi I don't think there's a PR already present. Are we confident it's all 6 update calls, or just the one I referenced above?

@zkrising
Copy link
Contributor

zkrising commented Apr 3, 2021

Haven't tested but from a cursory glance I think all of those update calls should be UpdateResult (UpdateWriteOpResult is for upserting, i think?)

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

2 participants