【发布时间】:2021-06-20 07:43:36
【问题描述】:
我正在使用 nestjs 并尝试通过 typeorm 和 mongodb 驱动程序添加一个自动增量列,但没有发生任何事情,也没有创建该列 这就是我的命令
import { Column, Entity, Generated, ObjectIdColumn } from "typeorm";
@Entity({name : 'employees'})
export class Employees {
@ObjectIdColumn()
id : string
@Column({type : 'string'})
userName : string
@Column({type : 'string'})
fullName : string
@Column()
@Generated('increment')
employeeID : string
该功能在 mongodb 中可用还是仅在 mysql 中可用
【问题讨论】: