@nestjs/mongoose#InjectModel TypeScript Examples

The following examples show how to use @nestjs/mongoose#InjectModel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: tracks.service.ts    From codeclannigeria-backend with MIT License 6 votes vote down vote up
constructor(
    @InjectModel(Track.modelName)
    protected readonly EntityModel: ReturnModelType<typeof Track>,
    @InjectModel(Stage.modelName)
    protected readonly StageModel: ReturnModelType<typeof Stage>,
    @InjectModel(TrackMentor.modelName)
    protected readonly trackMentorModel: ReturnModelType<typeof TrackMentor>,
    protected readonly userService: UsersService
  ) {
    super(EntityModel);
  }
Example #2
Source File: user.service.ts    From Phantom with MIT License 6 votes vote down vote up
constructor(
    @InjectModel('User') private readonly userModel: Model<user>,
    @InjectModel('Topic') private readonly topicModel: Model<topic>,
    @InjectModel('Pin') private readonly pinModel: Model<pin>,
    @InjectModel('Board') private readonly boardModel: Model<board>,
    @InjectModel('Chat') private readonly chatModel: Model<chat>,
    @InjectModel('Message') private readonly messageModel: Model<message>,

    private notification: NotificationService,
    private email: Email,
    private ValidationService: ValidationService,
    private boardService: BoardService,
  ) { }
Example #3
Source File: course.service.ts    From edu-server with MIT License 6 votes vote down vote up
constructor(
    @InjectModel('Course') private readonly CourseModel: Model<Course>,
    @InjectModel('Schedule') private readonly ScheduleModel: Model<Schedule>,
    @InjectModel('Review') private readonly ReviewModel: Model<Review>,
    @InjectModel('Doubt') private readonly DoubtModel: Model<Doubt>,
    @InjectModel('DoubtAnswer')
    private readonly DoubtAnswerModel: Model<DoubtAnswer>,
    @InjectModel('Assignment')
    private readonly AssignmentModel: Model<Assignment>,
    @InjectModel('Lecture') private readonly LectureModel: Model<Lecture>,
    @InjectModel('Mentor') private readonly mentorModel: Model<Mentor>,
  ) {}
Example #4
Source File: notification.service.ts    From Phantom with MIT License 6 votes vote down vote up
constructor(@InjectModel('User') private readonly userModel: Model<user>) {
    this.params = {
      type: String(process.env.FIREBASE_CREADENTIAL_TYPE),
      projectId: String(process.env.FIREBASE_CREADENTIAL_PROJECT_ID),
      privateKeyId: String(process.env.FIREBASE_CREADENTIAL_PRIVATE_KEY_ID),
      privateKey: String(
        process.env.FIREBASE_CREADENTIAL_PRIVATE_KEY.replace(/\\n/g, '\n'),
      ),
      clientEmail: String(process.env.FIREBASE_CREADENTIAL_CLIENT_ID),
      clientId: String(process.env.FIREBASE_CREADENTIAL_CLIENT_EMAIL),
      authUri: String(process.env.FIREBASE_CREADENTIAL_AUTH_URI),
      tokenUri: String(process.env.FIREBASE_CREADENTIAL_TOKEN_URI),
      authProviderX509CertUrl: String(
        process.env.FIREBASE_CREADENTIAL_AUTH_PROVIDER_X509_CERT_URL,
      ),
      clientX509CertUrl: String(
        process.env.FIREBASE_CREADENTIAL_CLIENT_X509_CERT_URL,
      ),
    };
    this.app = firebase.initializeApp({
      credential: firebase.credential.cert(this.params),
    });
    this.HelpersUtils = new HelpersUtils();
  }
Example #5
Source File: mentor.service.ts    From codeclannigeria-backend with MIT License 6 votes vote down vote up
constructor(
    @InjectModel(MentorMentee.modelName)
    private mentorMenteeModel: ReturnModelType<typeof MentorMentee>,
    @InjectModel(TrackMentor.modelName)
    private trackMentorModel: ReturnModelType<typeof TrackMentor>,
    @InjectModel(Submission.modelName)
    private SubmissionModel: ReturnModelType<typeof Submission>,
    private mailService: MailService
  ) {}
Example #6
Source File: board.service.ts    From Phantom with MIT License 5 votes vote down vote up
constructor(
    @InjectModel('Board') private readonly boardModel: Model<board>,
    @InjectModel('Pin') private readonly pinModel: Model<pin>,
    @InjectModel('Topic') private readonly topicModel: Model<topic>,
    @InjectModel('User') private readonly userModel: Model<user>,
    private ValidationService: ValidationService,
  ) {}
Example #7
Source File: announcement.service.ts    From edu-server with MIT License 5 votes vote down vote up
constructor(
    @InjectModel('Announcement')
    private readonly AnnouncementModel: Model<Announcement>,
  ) {}
Example #8
Source File: app.service.ts    From nestjs-file-streaming with MIT License 5 votes vote down vote up
constructor(
    @InjectModel('fs.files') private readonly fileModel: Model<File>,
    @InjectConnection() private readonly connection: Connection,
  ) {
    this.bucket = new mongo.GridFSBucket(this.connection.db)
  }
Example #9
Source File: users.seeder.ts    From nestjs-seeder with MIT License 5 votes vote down vote up
constructor(@InjectModel(User.name) private readonly user: Model<User>) {}
Example #10
Source File: product.repository.mongo.ts    From nest-js-products-api with MIT License 5 votes vote down vote up
constructor(
    @InjectModel('Product') private readonly productModel: Model<ProductEntity>,
  ) {}
Example #11
Source File: users.service.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
constructor(
    @InjectModel(User.modelName)
    protected readonly userEntity: ReturnModelType<typeof User>
  ) {
    super(userEntity);
  }
Example #12
Source File: chat.service.ts    From Phantom with MIT License 5 votes vote down vote up
constructor(
    @InjectModel('User') private readonly userModel: Model<user>,
    @InjectModel('Chat') private readonly chatModel: Model<chat>,
    @InjectModel('Message') private readonly messageModel: Model<message>,

    private ValidationService: ValidationService,
  ) {}
Example #13
Source File: cats.service.ts    From nestjs-tenancy with MIT License 5 votes vote down vote up
constructor(
        @InjectModel(Cat.name) private readonly catModel: Model<Cat>
    ) { }
Example #14
Source File: auth.service.ts    From NextJS-NestJS-GraphQL-Starter with MIT License 5 votes vote down vote up
constructor(
    @InjectModel('User') private readonly userModel: Model<User>,
    @InjectModel('Session') private readonly sessionModel: Model<Session>,
  ) {}
Example #15
Source File: user.repository.ts    From uniauth-backend with MIT License 5 votes vote down vote up
constructor(@InjectModel(User.name) private userModel: Model<UserDocument>) {}
Example #16
Source File: users.repository.ts    From nest-js-boilerplate with MIT License 5 votes vote down vote up
constructor(@InjectModel(User.name) private usersModel: Model<UserDocument>) {}
Example #17
Source File: sequence.service.ts    From whispr with MIT License 5 votes vote down vote up
constructor(@InjectModel('Sequence') private sequenceModel: Model<ISequence>) {}
Example #18
Source File: application.service.ts    From uniauth-backend with MIT License 5 votes vote down vote up
constructor(
    @InjectModel(Application.name) private applicationModel: Model<ApplicationDocument>,
    @InjectModel('User') private userModel: Model<UserDocument>,
    @Inject(WINSTON_MODULE_PROVIDER) private readonly logger = new Logger('application'),
  ) {}
Example #19
Source File: preAuth.middleware.ts    From edu-server with MIT License 5 votes vote down vote up
constructor(@InjectModel('User') private readonly userModel: Model<User>) {}
Example #20
Source File: user.service.ts    From uniauth-backend with MIT License 5 votes vote down vote up
constructor(
    @InjectModel('User') private userModel: Model<UserDocument>,
    @Inject(WINSTON_MODULE_PROVIDER) private readonly logger = new Logger('user'),
  ) {}
Example #21
Source File: temp-token.service.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
constructor(
    @InjectModel(TemporaryToken.modelName)
    protected readonly tokenEntity: ReturnModelType<typeof TemporaryToken>
  ) {
    super(tokenEntity);
  }
Example #22
Source File: users.repository.ts    From nest-js-boilerplate with MIT License 5 votes vote down vote up
constructor(@InjectModel(User.name) private usersModel: Model<UserDocument>) {}
Example #23
Source File: userstage.service.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
constructor(
    @InjectModel(UserStage.modelName)
    protected readonly UserStageModel: ReturnModelType<typeof UserStage>,
    protected readonly userService: UsersService
  ) {
    super(UserStageModel);
  }