Mongoose membuat objek diperlukan

const extraDataSchema = new mongoose.Schema({
  brand: {
    type: String,
    required: true,
    minlength: 1,
    maxlength: 255
  },
  quantity: {
    type: Number,
    required: true,
    minlength: 1,
    maxlength: 10
  }
});

const productSchema = new mongoose.Schema({
  name: {
    type: String,
    required: true,
    minlength: 1,
    maxlength: 255
  },
  extraData: {
    type: extraDataSchema, required: true
  }
});
Crowded Crocodile