const allVideos = await db.query.videos.findMany({
where: // Not all videos have timestamps (one-to-many). Exclude those somehow
with: {
timestamps: true
},
});
// Below should not be done in memory.
return allVideos.filter(
(video) => video.timestamps.length > 0
);
const allVideos = await db.query.videos.findMany({
where: // Not all videos have timestamps (one-to-many). Exclude those somehow
with: {
timestamps: true
},
});
// Below should not be done in memory.
return allVideos.filter(
(video) => video.timestamps.length > 0
);