File size: 343 Bytes
7b850b7
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import { Connection } from 'mongoose';
import { USERS, USER_REPOSITORY } from 'src/constants';
import { UserSchema } from './user.schema';

export const usersProviders = [
  {
    provide: USER_REPOSITORY,
    useFactory: (connection: Connection) => connection.model(USERS, UserSchema),
    inject: ['DATABASE_CONNECTION'],
  },
];