Ugly code to send message from user A to user B

To test, connect to server with something like Dark WebSocket Terminal then send the message:

{"event":"message", "data": { "from": "a397b829-c29a-4e3b-a6b4-4bef1fa1b51f", "to" :"37966a99-12d6-46e9-afd8-976d237dd9aa", "message": "hello" } }

Where "from" and "to" represent the sender and receiver's user IDs
So its as if user A is sending "hello" to user B

Afterwards, go to mongo and inspect:
db.users.find()
db.chats.find()

There should be a new insertion in the messages array of the chat document shared by user A and user B