UNPKG

@wearesage/schema

Version:

A flexible schema definition and validation system for TypeScript with multi-database support

23 lines (18 loc) 397 B
import "reflect-metadata"; import { Entity, Id, Property, ManyToMany } from "../.."; import { Post } from "./Post"; @Entity() export class Hashtag { @Id() id: string; @Property({ required: true, unique: true }) name: string; @Property() trendingScore: number = 0; @ManyToMany({ target: () => Post, inverse: "hashtags", name: "TAGGED_IN", }) posts: Post[] = []; }