File.mjs 490 B

1234567891011121314151617181920212223242526
  1. import mongoose from '../infrastructure/Mongoose.mjs'
  2. const { Schema } = mongoose
  3. export 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. export const File = mongoose.model('File', FileSchema)