For example
@Entity()
class Post {
@Column()
post_hash: string;
@Column()
title: string;
categorys: Array<Category> = [];
}
@Entity()
class Category {
@Column()
content: string;
@Column()
post_hash: number;
}
I want to query all the category
content of the corresponding post
through Typeorm.
I tried this method and failed.
this.createQueryBuilder('Post').leftJoinAndMapOne(
'Post.categorys',
Category,
'category',
'category.post_hash = post.post_hash'
)
This is my error message.
QueryFailedError: relation "post" does not exist