2019-11-18 09:03:20 -05:00
|
|
|
const mongoose = require('../infrastructure/Mongoose')
|
2019-05-29 05:21:06 -04:00
|
|
|
const { DocSchema } = require('./Doc')
|
|
|
|
const { FileSchema } = require('./File')
|
|
|
|
|
|
|
|
const { Schema } = mongoose
|
|
|
|
|
|
|
|
const FolderSchema = new Schema({
|
2021-04-27 03:52:58 -04:00
|
|
|
name: { type: String, default: 'new folder' },
|
2019-05-29 05:21:06 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
FolderSchema.add({
|
|
|
|
docs: [DocSchema],
|
|
|
|
fileRefs: [FileSchema],
|
2021-04-27 03:52:58 -04:00
|
|
|
folders: [FolderSchema],
|
2019-05-29 05:21:06 -04:00
|
|
|
})
|
|
|
|
|
2019-11-18 09:03:20 -05:00
|
|
|
exports.Folder = mongoose.model('Folder', FolderSchema)
|
2019-05-29 05:21:06 -04:00
|
|
|
exports.FolderSchema = FolderSchema
|