Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find last 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]
 
PREVIOUS NEXT
Tagged: #find #prisma
ADD COMMENT
Topic
Name
3+4 =