How i get all elements with no relation

prisma

#1

My prisma schema

type File {
 ...
  directory: Directory
  createdAt: DateTime! @createdAt
  updatedAt: DateTime! @updatedAt
  active: Boolean @default(value: true)
  comments: [Comment!]!
}

i want get only all Files with not relation in Directoy column.

if i try that, i have all lines

await prisma
        .project({ id: project_id })
        .directories()

if i try that, i have no lines ( undefined and null )

await prisma
        .project({ id: project_id })
        .directories({ where: { parent: { id: undefined } } }

i need help :frowning:


#2

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.