typeorm相关内容
我有两个表: @Entity('Reviews') class Review { ... @OneToMany((type) => MapCategory, map => map.review) public categories: MapCategory[]; } 和: @Entity('MapCategories') export class MapCategory
..
我尝试通过联接typeorm中的表来选择特定列。 当我看到以下材料时,会看到示例代码。 https://orkhan.gitbook.io/typeorm/docs/select-query-builder#joining-relations const user = await createQueryBuilder("user") .leftJoinAndSelect(
..
我有一个Singer实体和一个相关的Song实体 Singer实体 export class Singer { @PrimaryGeneratedColumn() id: number; @Column() name: string; @OneToMany( type => Song, Song => Song.user ) son
..
我要创建用户权限管理。我在PostgreSQL中使用TypeORM。以下是用户实体内权限的列定义: @Column({ type: 'text', array: true }) permissions: UserPermission[] = []; 这是UserPermission枚举: export enum UserPermission { APP_USER = '
..
例如: 3个表 user user_business_lines_business_line business_line 由typeorm使用User中的声明创建的 @ManyToMany(type => BusinessLine) @JoinTable() businessLines: BusinessLine[] 那么,如何添加列字段,如 @CreateDate
..
不工作代码只是为了说明我要实现的目标 一些连接文件 import { ConnectionManager } from 'typeorm'; const c = new ConnectionManager(); // user ormconfig.conf file export const connection = c.createAndConnect(); 在某些型号中使用
..
我正在尝试使用TypeORM获取basic setup工作,并在安装后收到此错误。 这里是一个REPL(只需执行yarn install && yarn db:dev,然后执行yarn db:migrate && yarn start即可重现错误) Inserting a new user into the database... { EntityMetadataNotFound: N
..
我正在开发一个Express(使用TypeORM)+ReactJS应用。 问题是我有3个实体通过OneToMany关系链接,如下所示: 客户 产品(链接到客户) 型号(链接到产品) import { Product } from './product.entity' @Entity('customer') export class Customer extends Base
..
假设我拥有此服务: @Injectable() export class MyService { constructor( @InjectRepository(A) private aRepository: Repository, @InjectRepository(B) private bRepository: Repository, )
..
要测试的类 我的TypeORM存储库extendsAbstractRepository: @EntityRepository(User) export class UsersRepository extends AbstractRepository { async findByEmail(email: string): Promise { retu
..
一些.entity.ts amount:number 但是当我在Postgres中存储非常大的数据时,它抛出错误‘’整数超出范围‘’ 我的问题是如何使用typeorm将Big Int作为type存储在psql中 推荐答案 定义类型bigintin@Column Decorator, @Column({type: 'bigint'}) columnName: str
..
我按照说明设置了一个Nest.Js/TypeORM/MongoDB堆栈here。 使用create()函数在MongoDB中创建对象用户,对象被记录到正确的数据库中的User集合中。 但是,当我尝试使用find({id})或findAll()函数获取它时,出现错误,并且无法从数据库获取该项目,即使它在那里。 这是我的user.service.ts文件: import { I
..
我有以下不相关的TypeORM实体(由于各种原因,我不能对它们使用一个/多个关系): @Entity() export class Book { @PrimaryGeneratedColumn() id: number; @Column() name: string; } @Entity() export class BookCategory { @Prim
..
我有两个实体,一个是car,另一个是carAvailability import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm'; import { CarAvailability } from 'src/car-availabilitys/car-availability.entity'; @Ent
..
为nestjs-typeorm-mongo项目创建初始迁移时遇到问题。 我已经克隆了this sample project from nestjs that uses typeorm with mongodb。当我将";Photo";文档放入名为";test";的本地mongo和集合";Phots";之后,我可以在本地运行该项目,这样我就可以调用l
..
我正在尝试将一些图像保存在Postgres数据库上,但仅保存了10字节的数据。 流程如下: 我在服务器上收到一个base64编码的字符串,然后将其加载到缓冲区,将其设置为我的实体并保存。 但是,然后尝试从数据库恢复该信息,我只得到了10个字节的数据,并在查询中使用octet_length()进行了验证。 我的实体属性定义: @Column({ "name": "entima_i
..
我正在使用NestJS和TypeORM构建API。我一直使用TypeORMRepository API查询MySQL数据库,主要是因为NestJS Database documentation section提供了一个使用this.photoRepository.find()的示例。随着时间的推移,我注意到我的许多探索性搜索结果出于性能和灵活性的原因推荐使用TypeORMQueryBuilder
..
有人能帮忙吗? 我需要使用TypeORM/NestJS将文件上传到PostgreSQL数据库。文件是表单的一部分。 我已采用以下实体类。 export class Certificate { @ApiProperty() @PrimaryGeneratedColumn() @Exclude() id: number; @ApiPropert
..
我一直在使用TypeORM没有问题,但是在进行API调用时突然弹出这个错误: EntityMetadataNotFound:找不到“BusinessApplication"的元数据.在新的 EntityMetadataNotFoundError (C:\Users\Robbie\Code\fit-society\node_modules\typeorm\error\EntityMetadataN
..
我试图找出使用 type-graphql 和 typeorm 和 postgresql db(使用 apollo 服务器和 express)处理一对多关系的最佳方法.我有一个与课程表具有一对多关系的用户表.我目前处理此问题的方法是使用 @RelationId 字段创建一列 userCourseIds,然后使用 @FieldResolver 和 dataloader 批量获取属于该用户的课程.我的问
..