-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
types: Add Expression Typings to Pipeline Stages #11370
Conversation
I guess if I do every day about 20-30 Expressions than in 4-5 days this big chunk of code is done. Then we can use them for the PipelineStages and Queries. Should be better than the any typings we have currently. Also there is I think a typescript feature were you can build attribute names based on strings to do stuff like key.$ where key is a key in an interface. But I think this could result in annoying issues like somebody using older typescript could not use the typings or you have keys after a projection stage were you don't have the typings of. Anyway, I guess, the best benefit will be when the pipeline stages have better expression support, were you know which fields are existing in an expression. So this will be the goal of this PR. |
I should Copy more Of the documentation into the jsdoc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor comments, but LGTM in general. Worst comes to worst re: casting, we just add some any
, but I think this change is great for autocomplete
It should cover all expressions. It is purely based on the mongodb-Documentation. |
@vkarpov15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got a couple of minor comments but LGTM overall
"test/files/*" | ||
"website.js", | ||
"test/files/*", | ||
"benchmarks" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to avoid linting benchmarks and website.js
? Doesn't seem like the right thing to do, but I might be missing something
"@typescript-eslint/space-infix-ops": "off" | ||
"overrides": [ | ||
{ | ||
"files": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these changes necessary?
/** | ||
* Returns the tangent of a value that is measured in radians. | ||
* | ||
* @version 4.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get rid of the @version
tags? It's a bit confusing because @version
refers to the MongoDB server rather than the Mongoose version
Just a heads up that this PR broke a lot of our aggregations' typings, see more details in #11952 |
I opened #11956 to fix this. |
To be implemented: