📜  typeorm mongodb 连接 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:09             🧑  作者: Mango

代码示例1
export class UserService {
    private userRepository: UserRepository;
    private authRepository: AuthRepository;
    constructor(
        private readonly connection: Connection
    ) {
        this.userRepository = this.connection.getCustomRepository(UserRepository);
        this.authRepository = this.connection.getCustomRepository(AuthRepository);
    }
}