'How do I create a new product from a schema that has arrays?
I have a schema set up like this:
var projectSchema = new MONGOOSE.Schema({
name: String,
variety:[{
title: String,
description: String
}],
});
Can anyone help me on how to receive this data from the user in a new form, if I want to add just two varieties. And how to design the post route for this to create a new product?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|