undeexcepturi
Version:
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 JavaScript.
22 lines (21 loc) • 675 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BookTagSchema = exports.BookTag = void 0;
const core_1 = require("@mikro-orm/core");
const Book_1 = require("./Book");
class BookTag {
constructor(name) {
this.books = new core_1.Collection(this);
this.name = name;
}
}
exports.BookTag = BookTag;
exports.BookTagSchema = new core_1.EntitySchema({
class: BookTag,
properties: {
_id: { type: 'ObjectId', primary: true },
id: { type: 'string', serializedPrimaryKey: true },
name: { type: 'string' },
books: { kind: 'm:n', entity: () => Book_1.Book, mappedBy: 'tags' },
},
});