I'm learning full stack development and on this project I'm working on I have a schema with the following:
var questionSchema = new mongoose.Schema(
{
language: String,
precedence: [String],
body: [{
answer: String,
correction: Number,
mandatory: Number,
eliminative: Number,
points: Number
}],
type: String,
});
After initiliazing the connection to the server, I use Postman to try things out and whenever I do a POST, the "precedence":
will always come before the "_id":
. I had the same happening with the "body":
but somehow i fixed it. It doesn't matter if the array is empty or not, it will still be on top. I'm going to start with my front-end development now, something I'm completely new to, and I have no idea if this is an error that can cause problems further ahead. How can i fix this?