Reputation: 113
This is the router I have created
This is the POSTMAN output UPDATED
This is request I am sending...
Except for my array of objects, I am getting output for everything. How to get the output for an array of object? how to resolve this issue?
I have already used app.use(bodyParser.json()); but still, I am not getting the array of objects(Materials)
** NOTE:** I have highlighted in the images where I am facing the issue?
Upvotes: 0
Views: 135
Reputation: 5066
Try to define your Schema with type prop for Materials:
...
Materials: {
type: [{
Particular: String,
// also you have a typo
Quantity: Number,
Price: Number,
ROG: Number,
Amount: Number,
}]
}
...
And another typo in your request body:
Upvotes: 1