quaerateum
Version:
Simple typescript ORM for node.js based on data-mapper, unit-of-work and identity-map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JS.
24 lines (16 loc) • 481 B
text/typescript
import { ObjectID } from 'mongodb';
import { Collection, Entity, ManyToMany, PrimaryKey, Property, IEntity } from '../../lib';
import { Book } from './Book';
()
export class BookTag {
()
_id: ObjectID;
()
name: string;
({ entity: () => Book.name, mappedBy: 'tags' })
books: Collection<Book> = new Collection<Book>(this);
constructor(name: string) {
this.name = name;
}
}
export interface BookTag extends IEntity { }