There is a simple way to filter out channels that are empty or do not have any messages in them. Although it is not immediately intuitive, you can pass a timestamp for the last_message_at that is sometime in the past (below I used a date in 2020). This will do the trick
const filters = { type: "messaging", members: { $in: ["katie"] }, last_message_at: {$gte: "2020-01-01T00:00:00.00Z"} };
Comments
1 comment
This trick works, but there's no way I can figure out to do the reverse.
I want to filter to just the empty channels, but it's not possible to do with the current filters.
Please sign in to leave a comment.