@jfln/marvin-db
Version:
biblioteca de objetos para normalizar o acesso a um banco mongo db
29 lines (21 loc) • 570 B
text/typescript
import {PrimaryKey, Property, SerializedPrimaryKey} from '@mikro-orm/core'
import {ObjectId} from '@mikro-orm/mongodb'
export abstract class BaseEntity {
()
_id!: ObjectId
()
id!: string
()
guildId: string
({onCreate: () => new Date()})
createdAt: Date = new Date()
({onUpdate: () => new Date()})
updatedAt: Date = new Date()
public setGuildId(guildId: string): this {
this.guildId = guildId
return this
}
constructor(guildId: string) {
this.guildId = guildId
}
}