Prisma how to get data from relation as using 'where'?

my User prisma schema User model has like[]: model User { likes Like[] } and Like model has createdAt. model Like { id Int @id @default(autoincrement()) user User @relation(fields: [userId], references: [id], onDelete: Cascade) userId Int createdAt DateTime @default(now()) @@unique([feedId, userId]) } I want to get data how many times user links to Like model… Read More Prisma how to get data from relation as using 'where'?

Why map() function can't make a new Array?

I use react-native with graphQL. selectPhoto is an array containing two strings. Array [ "file:///storage/emulated/0/DCIM/Camera/20220223_150530.jpg", "file:///storage/emulated/0/DCIM/Camera/20220223_150453.jpg", ] and I use map to make new array with this array. const onValid = async ({ caption }) => { const file = selectPhoto.map((sp, index) => { console.log(sp, index); new ReactNativeFile({ uri: sp, name: `${index}.jpg`, type: "image/jpeg", });… Read More Why map() function can't make a new Array?