message.ts 649 B

1234567891011121314151617181920212223242526272829303132333435
  1. import mongoose from 'mongoose';
  2. const { Schema } = mongoose;
  3. const appData = {
  4. msgId: {
  5. type: String,
  6. required: true,
  7. },
  8. msgLogDateTime: {
  9. type: Date,
  10. required: true,
  11. default: () => Date.now()
  12. },
  13. msgDateTime: {
  14. type: Date,
  15. required: true,
  16. default: () => Date.now()
  17. },
  18. msgTag: [String],
  19. msgPayload: {
  20. type: String,
  21. required: true
  22. }
  23. }
  24. const messageSchema = new mongoose.Schema({
  25. appLogLocId: {
  26. type: String,
  27. ref: `appLogLoc`,
  28. required: true
  29. },
  30. appData: appData
  31. });
  32. module.exports = messageSchema