Databases

Step 4: To get chat messages from your database, find where you are sending back the messages, and add the following before it:
let messages = await db.collection(`messages`).find().toArray()
The find method could take some time to complete, so await is used, which means async must be placed on front of the function:
app.get(`/messages`, async (request, response) => {
Last step Next step