gallery.js 490 B

12345678910111213141516171819202122
  1. const mongoose = require("mongoose");
  2. const GallerySchema = new mongoose.Schema({
  3. owner: {
  4. type: mongoose.Schema.Types.ObjectId,
  5. ref: "Uploader",
  6. required: true
  7. },
  8. title: {
  9. type: String,
  10. required: true
  11. },
  12. tags: [String],
  13. images: [String],
  14. location: {
  15. type: {type: String},
  16. coordinates: [],
  17. }
  18. });
  19. GallerySchema.index({location: "2dsphere"});
  20. module.exports = mongoose.model("Gallery", GallerySchema);