You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

  1. var mongoose = require('mongoose'),
  2. Schema = mongoose.Schema;
  3. var travelSchema = new Schema({
  4. title: { type: String },
  5. description: { type: String },
  6. owner: { type: String },
  7. from: { type: String },
  8. to: { type: String },
  9. date: { type: Date },
  10. periodic: { type: Boolean },
  11. generateddate: { type: Date },
  12. seats: { type: Number },
  13. package: { type: Boolean },
  14. icon: { type: String },
  15. phone: { type: Number },
  16. telegram: { type: String },
  17. collectivized: { type: Boolean },
  18. modality: { type: String }, //if is an offering travel or asking for travel
  19. joins: [{
  20. joinedUserId: { type: String },
  21. joinedUsername: { type: String },
  22. acceptedUserId: { type: String },
  23. joinedAvatar: { type: String }
  24. }],
  25. comments: [{
  26. commentUserId: { type: String },
  27. commentUsername: { type: String },
  28. comment: { type: String },
  29. commentAvatar: { type: String }
  30. }]
  31. })
  32. module.exports = mongoose.model('travelModel', travelSchema);
  33. //modality can be: offering, asking, package