I have a many-to-many relationship between jobs an...
# orm-help
k
I have a many-to-many relationship between jobs and locations. I first seed the locations and then when seeding the jobs I am trying to connect them with some locations like this
locations: { connect: [{ id: 1 }, { id: 2 }] },
but it is not connecting the jobs with locations. any ideas what I am doing wrong?
1
a
Not a direct answer to your question, but the thing that helped me learn Prisma the most is clicking through (using your IDE’s features) the different definitions and types (found in
index.d.ts
) to understand the query structure needed for a given query. Alternatively, just reading the generated
index.d.ts
file should help you understand what you need! Good luck!
k
Thanks for answering Ansel I appreciate your time. I already read that file that is how I came up with the connect and the array of objects with the id. The thing is this question is invalid and needs to be ignored, I am just silly and did not understand that to refresh a table in dbeaver I have to also press F5 and not just double click it to refresh/update it. So the connection did actually work fine 🤦‍♂️
v
Hi @Kostas Karaolis, thank you for sharing the solution! No question is invalid, and all knowledge is super helpful - It's great to hear that you solved it! 😊
☺️ 1