A common use case is to filter out empty channels and return only channels with messages to the user, or the opposite, having an inbox with only empty channels.
This can be accomplished with a simply addition to your QueryChannels filter, using the $exists operator.
Retrieving empty channel
const filters={
last_message_at:{ $exists: false },
//other filters... ,
};
Retrieving a channel with messages only
const filters={
last_message_at:{ $exists: true },
//other filters... ,
};
To return only empty channels to the channel creator, a common use case for 1-1 chats, please review this guide
Guide: Use queryChannels filters to return empty channels only to the channel creator
Comments
0 comments
Please sign in to leave a comment.