Как загрузить изображения в aws s3 и сохранить URL-адрес в mongoDB с помощью узла express - PullRequest
1 голос
/ 10 июля 2020

Как загрузить несколько изображений в aws s3 и сохранить URL-адрес publi c в mongoDB, используя node express и mon goose

Schema

const shopSchema = new Schema({
  shopName: {
    type: String,
    required: true
  },
  ownerName:{
    type: String,
    required:true
  },
  phoneNumber:{
    type:String,
    required:true
  },
  image: {
    type: String,
    required: true
  },
  passbook: {
    type: String,
    required: true
  },
  certificate: {
    type: String,
    required: true
  },
  location: {
    type: { type: String },
    coordinates: [],
    
   },
  password:{
    type:String,
    required:true
  },
  isVerified:{
    type:Boolean,
    default:false,
    required:true
  }
  ,
  foodId: [{
    type: Schema.Types.ObjectId,
    ref: 'Food',
  }]
});

i уже использовали multer и хранятся на локальном устройстве, но у меня проблема с развертыванием

Необходимо сохранить URL-адреса в изображениях, сертификате, полях сберегательной книжки

...