Recently I've built a chat app using react + firebase but there's something that doesn't work quite right.
I'm able to send messages and have them stored in the firebase database. Now here's the problem: it only shows the first 25 messages that got stored.
Here's the part of the code that's problematic:
const messagesRef = firestore.collection("messages");
const query = messagesRef.orderBy("createdAt").limit(25);
Is there a way to start at the bottom from the last 25 message? Using "desc" doesn't work either because it displays the data starting from the last message at the top and I want the exact opposite.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment