In my case, I need to mutate list of classes which have a foreign key teacher_id. While “upsert” feature is not working for teacher_id.
And then I read the uid of teacher before inserting and committing each class, but uid returns None. I guess it is because Dgraph commits the transactions in a batch, although I set the commit by each class. After committing all the jobs, I query the teachers, which returns multiple teacher nodes for the same id.
Am I using the “upsert” right? Would you help me how to handle this case? Thanks.
BTW, I am using Dgraph Docker v1.0.7, and pydgraph==1.0.0
teacher_id: string @index(hash, trigram) @upsert .