Why does mongo do not correctly add it to your library records?

Good time of day.
Is the scheme comments:
var commentSchema = mongoose.Schema({
 text: String,
 postNum: Number,
 num: Number,
 rating: [],
 addtime: String,
 to: Number

So, saving the method save all the new comments,I noticed: after 12 records she starts to shove the new entry in front of all the existing ones.
(green - OK))) red - I've got something wrong)
Don't know if this helps, but usually retain, like so:
Comment.count({}, function (err, count) {
 var newComment = new Comment;
 newComment.text = comment;
 newComment.authorId = authorId;
 newComment.num = count + 1;
 newComment.postNum = postNum;
 newComment.save(function (err) {
 if(err) throw err;
September 19th 19 at 00:03
2 answers
September 19th 19 at 00:05
Do not create indexes on the fields? when you create, you can specify the sort of storage, do not know whether it affects the sample without the use of this field. And so I advise you not to focus on the order of insertion, and to use a common tool "sort" to specify exactly in which order to show.
You can still try directly through the console, to make a request if it will return correctly, the interface works well.
With the interface, all the rules, thank you. Sort helped. - damion_Jast commented on September 19th 19 at 00:08
September 19th 19 at 00:07

Find more questions by tags MongooseMongoDBDatabasesJavaScriptNode.js