appointmentSchema.js 661 B

123456789101112131415161718192021222324252627282930313233343536
  1. import mongoose from "mongoose";
  2. const appointmentSchema = new mongoose.Schema({
  3. user: {
  4. type: String,
  5. required: true
  6. },
  7. title: {
  8. type: String,
  9. required: true
  10. },
  11. description: {
  12. type: String,
  13. required: true
  14. },
  15. dueDate: {
  16. type: Date,
  17. required: true
  18. },
  19. place: {
  20. type: String,
  21. required: true
  22. },
  23. startDate: {
  24. type: Date,
  25. required: true
  26. },
  27. endDate: {
  28. type: Date,
  29. required: true
  30. }
  31. });
  32. const Appointment = mongoose.model('Appointment', appointmentSchema, 'appointment');
  33. export default Appointment;