'MongoDB Direct Message List
I want to get a users message list. Similar to how Discord's direct messages list looks. Showing both latest incoming and outgoing messages. Is it possible to do so with the following schema? And if so with what query?
_id: ObjectId
sender: ObjectId
receiver: ObjectId
message: String
createdAt: Date
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
