Can't add object to MongoDB array inside a document
问题 I'm building an API for my chat application and I wrote the endpoint below to save new messages in MongoDB. The messages themselves are an array. Testing this endpoint with Postman returns the newly created message in the response but the message is not added to my array of messages. router.post('/:id/messages', async (request, response) => { const chatMessage = new Message({ type: request.body.type, body: request.body.body, author: request.body.author }); try { const newMessage = await