const allDMsThatFit = await asyncMap(channelsWithUser, async (doc) => {
const findDMsThatMatchInChannel = await ctx.db
.query('directMessages')
.withSearchIndex('search_content', (q) =>
q
.search('directMessageContent', args_0.searchQuery)
.eq('directMessageChannelId', doc.directMessageChannelId),
)
.take(5);
return {
findDMsThatMatchInChannel,
channelId: doc.directMessageChannelId,
};
});
const allDMsThatFit = await asyncMap(channelsWithUser, async (doc) => {
const findDMsThatMatchInChannel = await ctx.db
.query('directMessages')
.withSearchIndex('search_content', (q) =>
q
.search('directMessageContent', args_0.searchQuery)
.eq('directMessageChannelId', doc.directMessageChannelId),
)
.take(5);
return {
findDMsThatMatchInChannel,
channelId: doc.directMessageChannelId,
};
});