Correct usage of xid to upsert with Live uploader

Anthony nailed it. The predicate you specify in your flag will be used “as is” try this query instead:

{
 test(func: has(Student.courses), first:5) {
  Student.studentId
  xid
 }
}