W
W
Wasya UK2017-05-04 11:47:19
MongoDB
Wasya UK, 2017-05-04 11:47:19

How to sort by latest update in mongoose?

There is a Dialogues field in which there are correspondences . How to get a sorted array of conversations , by adding new messages to them ? In other words, by the date of the change. Is it possible to do this using Mongoose, or is it better to just add the modified date property to the correspondence , and then sort it manually?
ATP in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
emp1re, 2017-05-04
@dmc1989

add timestamps to schemes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question