Select distinct combination of two fields with a condition in MongoDB (Node JS)
I have this kind of collection named 'Message' [ { _id: new ObjectId("62641aea1fbe19349f8fba78"), text: 'Hello', user: new ObjectId("625b8f00e2464fb758263b4d"), receiver: new ObjectId("62638d3e5bcd98e7e48ca1b7"), createdAt: 2022-04-23T15:27:38.270Z, updatedAt: 2022-04-23T15:27:38.270Z, __v: 0 }, { _id: new ObjectId("6264256fc0ee5093f8d994a0"), text: 'Hi', user: new ObjectId("62638f1495b841266161b032"), receiver: new ObjectId("62638d3e5bcd98e7e48ca1b7"),…