Hi @ElvizLai
- Start with a fresh Dgraph runtime, and try without
@upsertdirective onemailfirst. You should see 20 email ids (same value) in Dgraph. You should not see anyTransaction has been aborted. Please retrymessage. This is what you might have seen in the system. - Now, drop data from Dgraph and add the
@upsertdirective onemail. Run the test again. This time only one node will be created. The@upsertdirective enforces uniqueness for theemailfield when running transactions concurrently. At this time, you should seeTransaction has been aborted. Please retry. This is caused by the@upsertdirective enforcing uniqueness on theemailattribute.
Please note that the presence of an index is mandatory for @upsert to work.