You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys, I have a question regarding the creation of new (business-)objects and the usage of them in within a service.
I have created a new Type "MonthView". Therefore I have an existing colleciton in my mongoDB which is called "monthviews". Now I want to do a simple .find operation in my service. I have created the model like that:
`import { InjectorService, JsonProperty } from 'ts-express-decorators';
import { prop, Typegoose, InstanceType, ModelType } from 'typegoose';
import { MonthViewRepoToken } from '../token-constants';
export type MonthViewInstance = InstanceType;
export type MonthViewRepo = ModelType;
InjectorService.factory(MonthViewRepoToken, new MonthView().getModelForClass(MonthView));
`
I am a little confused about the last line of code because this crashes my whole application. The login doesn't work any more, the same on signup route. When I comment the line out, then it starts to work again. It seems that the Collection "user" gets overwritten in some strange way. Can you maybe help me to figure that out?
Thanks!
The text was updated successfully, but these errors were encountered:
Hey guys, I have a question regarding the creation of new (business-)objects and the usage of them in within a service.
I have created a new Type "MonthView". Therefore I have an existing colleciton in my mongoDB which is called "monthviews". Now I want to do a simple .find operation in my service. I have created the model like that:
`import { InjectorService, JsonProperty } from 'ts-express-decorators';
import { prop, Typegoose, InstanceType, ModelType } from 'typegoose';
import { MonthViewRepoToken } from '../token-constants';
export class MonthView extends Typegoose {
}
export type MonthViewInstance = InstanceType;
export type MonthViewRepo = ModelType;
InjectorService.factory(MonthViewRepoToken, new MonthView().getModelForClass(MonthView));
`
I am a little confused about the last line of code because this crashes my whole application. The login doesn't work any more, the same on signup route. When I comment the line out, then it starts to work again. It seems that the Collection "user" gets overwritten in some strange way. Can you maybe help me to figure that out?
Thanks!
The text was updated successfully, but these errors were encountered: