2024-08-27 08:37:01 +08:00
|
|
|
import mongoose from "mongoose";
|
|
|
|
|
|
|
|
const CollectionSchema = mongoose.Schema(
|
|
|
|
{
|
2024-08-27 17:49:07 +08:00
|
|
|
name: {
|
2024-08-27 08:37:01 +08:00
|
|
|
type: String,
|
2024-08-27 17:49:07 +08:00
|
|
|
// required: true,
|
2024-08-27 08:37:01 +08:00
|
|
|
},
|
2024-08-27 17:49:07 +08:00
|
|
|
created_by: {
|
2024-08-27 08:37:01 +08:00
|
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
|
|
ref: "User",
|
|
|
|
},
|
2024-08-27 17:49:07 +08:00
|
|
|
header: [
|
2024-08-27 08:37:01 +08:00
|
|
|
{
|
2024-08-27 17:49:07 +08:00
|
|
|
key: {
|
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
value: {
|
2024-08-27 08:37:01 +08:00
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
//required: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{ timestamps: true }
|
|
|
|
);
|
|
|
|
|
|
|
|
const Collection = mongoose.model("Collection", CollectionSchema);
|
|
|
|
|
|
|
|
export default Collection;
|