I am facing this problem in nestjs.Project structure is like-
src-
-RegisterModule
-register.controller.ts
-register.service.ts
-register.dto.ts
-register.schema.ts
-register.module.ts
-app.module.ts
-app.controller.ts
-app.service.ts
Yaa....I got the solution in just 2 simple steps
MongooseModule.forFeature([{ name: 'Register', schema: registrationSchema }])
in registerModule's import section