dragonroll/backend/models/Book.js

13 lines
411 B
JavaScript
Raw Normal View History

2024-08-08 23:29:08 +00:00
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const BookSchema = new Schema({
title: {type: String, required: true},
authors: { type: [String] },
2024-09-11 18:03:09 +00:00
description: { type: String },
2024-08-08 23:29:08 +00:00
system: {type: String, required: true},
image: { type: String },
2024-09-11 18:03:09 +00:00
contents: [ {type: mongoose.Types.ObjectId, ref: "Concept"} ],
2024-08-08 23:29:08 +00:00
});
module.exports = mongoose.model('Book', BookSchema);