Open Yanis540 opened 5 months ago
You can't use .In when linking, it needs to be db.User.ID.Equals("cltuva3xs0000tn3vhv5oc13p")
. You can define multiple .ID.Equals for many
relations.
Okey that's the basic solution, but since in real life we tend to have more data like a slice of string what could we do then ??? i personnaly think that the solution with the In is more elegant ?? and i think it's also implemented in prisma ( javascript version), even if i know the golang version is still on alpha it might seem logical to put that into perspective ? https://stackoverflow.com/questions/72566290/how-to-use-where-in-in-prisma
You can use it in a where query yes, but not when linking objects. This is the same behavior as Prisma JS I believe. You can put multiple options in the .Link for many
relationships:
db.Foo.Bars.Unlink(
db.Bar.ID.Equals(id1),
db.Bar.ID.Equals(id2),
db.Bar.ID.In(ids),
),
Hi I'm expriencing some trouble with the IN operator,
here's my schema :
and doing this request :
i checked many times that the chat exists, and that the user with the ID cltuva3xs0000tn3vhv5oc13p exists.
Any idea ?