Arun Kumar
06/02/2021, 6:24 AMRyan
06/02/2021, 6:33 AMPrismaClient instance contains other properties as well.Arun Kumar
06/02/2021, 6:35 AMlet testJsonItem = prisma.myModel.map(function(){return jsonObject} ```Arun Kumar
06/02/2021, 6:36 AMArun Kumar
06/02/2021, 6:40 AMArun Kumar
06/02/2021, 7:10 AMRyan
06/02/2021, 7:17 AMUser it will be available as prisma.user.Arun Kumar
06/02/2021, 7:20 AMArun Kumar
06/02/2021, 7:21 AMArun Kumar
06/02/2021, 7:21 AMprisma.user) gives only the methods available on the modelRyan
06/02/2021, 7:23 AMdmmf :
const prisma = new PrismaClient()
// @ts-ignore
console.log(prisma._dmmf)
This will give you all fields and the structure of the modelsArun Kumar
06/02/2021, 7:39 AMDMMFClass {
outputTypeToMergedOutputType: [Function (anonymous)],
datamodel: {
enums: [],
models: [ [Object], [Object], [Object], [Object], [Object], [Object] ]
},
schema: {
inputObjectTypes: { prisma: [Array] },
outputObjectTypes: { prisma: [Array], model: [Array] },
enumTypes: { prisma: [Array] }Ryan
06/02/2021, 7:46 AMdatamodel.models contains all the models you need along with the fields/properties.Arun Kumar
06/02/2021, 7:47 AM