File.js 511 B

123456789101112131415161718192021222324252627
  1. const mongoose = require('../infrastructure/Mongoose')
  2. const { Schema } = mongoose
  3. const FileSchema = new Schema(
  4. {
  5. name: {
  6. type: String,
  7. default: '',
  8. },
  9. created: {
  10. type: Date,
  11. default() {
  12. return new Date()
  13. },
  14. },
  15. rev: { type: Number, default: 0 },
  16. linkedFileData: { type: Schema.Types.Mixed },
  17. hash: {
  18. type: String,
  19. },
  20. },
  21. { minimize: false }
  22. )
  23. exports.File = mongoose.model('File', FileSchema)
  24. exports.FileSchema = FileSchema