mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
bdc5360bc0
Use the default Mongoose connection pool for all models GitOrigin-RevId: d227b7eb36f130085c9eb1480dc07bd50ba57768
18 lines
439 B
JavaScript
18 lines
439 B
JavaScript
const mongoose = require('../infrastructure/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]
|
|
})
|
|
|
|
exports.Folder = mongoose.model('Folder', FolderSchema)
|
|
exports.FolderSchema = FolderSchema
|