mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
20 lines
446 B
JavaScript
20 lines
446 B
JavaScript
|
const mongoose = require('mongoose')
|
||
|
const { DocSchema } = require('./Doc')
|
||
|
const { FileSchema } = require('./File')
|
||
|
|
||
|
const { Schema } = mongoose
|
||
|
|
||
|
const FolderSchema = new Schema({
|
||
|
name: { type: String, default: 'new folder' }
|
||
|
})
|
||
|
|
||
|
FolderSchema.add({
|
||
|
docs: [DocSchema],
|
||
|
fileRefs: [FileSchema],
|
||
|
folders: [FolderSchema]
|
||
|
})
|
||
|
|
||
|
mongoose.model('Folder', FolderSchema)
|
||
|
exports.Folder = mongoose.model('Folder')
|
||
|
exports.FolderSchema = FolderSchema
|