Answers for "last field prisma"

3

last field prisma

// In prisma v3 to find last record in mydb:
const lastRecordObj = await prisma.mydb.findMany({
	orderBy: {
		id: 'desc',
	},
	take: 1
})

const lastRecord = lastRecordObj[0]
Posted by: Guest on January-05-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language