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

the type QueryWithHelpers is not recursive #10040

Closed
shlomiassaf opened this issue Mar 18, 2021 · 0 comments
Closed

the type QueryWithHelpers is not recursive #10040

shlomiassaf opened this issue Mar 18, 2021 · 0 comments
Labels
needs repro script Maybe a bug, but no repro script. The issue reporter should create a script that demos the issue typescript Types or Types-test related issue / Pull Request
Milestone

Comments

@shlomiassaf
Copy link
Contributor

Currently, to chain queries we can use QueryWithHelpers which returns the query and additional helper functions that also add conditions and return the query.

  type QueryWithHelpers<ResultType, DocType extends Document, THelpers = {}> = Query<ResultType, DocType, THelpers> & THelpers;

This is good for a single chain and there it stops since QueryWithHelpers return Query :)

The old typings @types/mongoose used to have the main Query (called DocumentQuery there) which returned all results with the THelpers added and also exposed Query with an empty THelpers which had the same affect.

This should solve the issue

@vkarpov15 vkarpov15 added this to the 5.12.2 milestone Mar 20, 2021
@vkarpov15 vkarpov15 added needs repro script Maybe a bug, but no repro script. The issue reporter should create a script that demos the issue typescript Types or Types-test related issue / Pull Request labels Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro script Maybe a bug, but no repro script. The issue reporter should create a script that demos the issue typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

No branches or pull requests

2 participants