Should We use entity without typeorm in nestJS, if we are using mongoose

898 views Asked by At

So, I am not using TypeOrm but mongoose for mongodb. The interfaces I create has no benefits for using Pipes because interface is typescript's behaviour and not Javascript's.

I have schema and Document but that too doesn't get into a lot of function arguments.
I get errors like

'UserDocument' only refers to a type, but is being used as a value here

(above UserDocument is created in the schema file with export type UserDocument = User & Document;)

What is the good practice if we are using mongoose ORM and the documents we make (with export type UserDocument = User & Document; or by making interfaces) are not available for most of the functions in nestJS.

0

There are 0 answers