overleaf/services/web/app/src/models/File.js
Eric Mc Sween bdc5360bc0 Merge pull request #2372 from overleaf/em-mongo-connection-pool
Use the default Mongoose connection pool for all models

GitOrigin-RevId: d227b7eb36f130085c9eb1480dc07bd50ba57768
2019-11-18 14:20:43 +00:00

24 lines
448 B
JavaScript

const mongoose = require('../infrastructure/Mongoose')
const { Schema } = mongoose
const FileSchema = new Schema({
name: {
type: String,
default: ''
},
created: {
type: Date,
default() {
return new Date()
}
},
rev: { type: Number, default: 0 },
linkedFileData: { type: Schema.Types.Mixed },
hash: {
type: String
}
})
exports.File = mongoose.model('File', FileSchema)
exports.FileSchema = FileSchema