Nodejs app with Express and MongoDB. I have form to insert title, author and body. After submitting data I noticed that instead of title, author and body it looks like body, author and title. So, I wonder is this order important in MongoDB? And why it switch positions. Image shows how it should be and what i got.
Code fragments (mongoose schema, pug view, main):
// article schema
let articleSchema = new Schema({
title: String,
author: String,
body: String
})
label Title:
input.form-control(name='title', type='text')
#form-group
label Author:
input.form-control(name='author', type='text')
#form-group
label Body:
textarea.form-control(name='body')
article.title = req.body.title
article.author = req.body.author
article.body = req.body.body
P.S. App working only confusing order in DB.
P.P.S. My question is similar to that, but not a duplicated, because, they talked about updating existing data in DB, while i'm talking about adding new data to DB. So it's obvious that after updating it will appear in the end. But when I want add new data, I thought it should look like I wrote in mongoose scheme. So, for now, I only know it's not so important, but I would like to know solution to fix this wrong order if one exists.