sort the messages
1
zfrika
sort messages is input messaging-system.js in public/script. what function handles the order of the files? loadMessages gets the messages. we want to sort by timestamp. can we sort by timestamp in the routes before we pass the data? are they being sorted by createdAt ? const results = await Message.find({datatoken:datatoken}).sort({ createdAt: -1 }).lean(); const results = await Message.find({datatoken:datatoken}).sort({ createdAt: -1 }).lean(); changed createAt to timestamp. because createAt doesnt exist int he messages table only timestamp.