Hey guys, i'm struggling to create a record with n...
# orm-help
g
Hey guys, i'm struggling to create a record with nested table using this model, even with a single record in the tags table i'm getting this error
βœ… 1
a
Hey there πŸ‘‹, Your nested write isn’t quite at the right level. Since
FinancialRecords.tags
is of type
TagsOnFinancialRecords
, you need to specify another level of nesting for the write:
Copy code
await prisma.financialRecords.create({
  data: {
    tags: {
      create: {
        tag: {
          create: {
            name: 'test'
          }
        }
      }
    }
  }
})
πŸ‘€ 1
g
@Austin worked like a charm, thank you
@Austin how i can extend this to create or connect while receiving a list of tags? (when i receive a tagId i want to connect, when not create)
idk if i did the right way, but it's working
πŸš€ 1