-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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] "insertMany" dosnt filter out functions #10144
Comments
I took a closer look at this, and unfortunately this is expected behavior. TypeScript can't accurately infer what properties are functions when using generic types: microsoft/TypeScript#43281, see discussion from #9989. So if we want to filter out function property names, we'd have to somehow forbid using Realistically, I think we're going to have to add a new generic to the |
…, no `extends Document` re: #10144
Do you want to request a feature or report a bug?
types problem
What is the current behavior?
Model.insertMany(here)
dosnt filter out functionsError (taken from code below):
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
that the mentioned function filters out functions
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
mongoose 5.12.4
typescript 4.2.3 / 4.2.2
PS:
the provided code is taken from trying to upgrade typegoose, and modified to be un-typegoosed ("native mongoose" only)
The text was updated successfully, but these errors were encountered: