Skip to content

@casl/ability with typegoose result - type Subject = DocumentType<Model> #680

Answered by stalniy
RemyMachado asked this question in Q&A
Discussion options

You must be logged in to vote

Typegoose is just over complicated thing. I’d recommend to use pure mongoose, its TS support is much better nowadays

In your case to make it work with mongoose use mongoose model names or extend Subjects to be UserModel | ForcedSubject<‘UserModel’>

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@RemyMachado
Comment options

Answer selected by RemyMachado
Comment options

You must be logged in to vote
2 replies
@johnsonjo4531
Comment options

@RemyMachado
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants