Properly Typing Mongoose Functions to Retain Document Methods #15438
felixwoestmann
started this conversation in
General
Replies: 1 comment
-
Why do you need to set an explicit return type? The explicit type of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to encapsulate Mongoose database operations in reusable functions, but I'm struggling with the TypeScript return type. When I extract database queries into helper functions, I lose access to document methods like
.save()
.When I try to move this query into a function like:
Beta Was this translation helpful? Give feedback.
All reactions