How to find nodes given an array of values

After having implemented your suggestion, I have three follow up questions:

  • Can an array be used with transaction.queryWithVars()?
  • If so, what would be the type that we would supply to the query below?
query allNames($emails: ???) {
  allNames(func: eq(name, $emails) {
    name
  }
}
  • What are the advantages of using queryWithVars() over template string variables?

Thanks for your help Michel