ETS - conditional match with variable in Elixir

Yes this produces the “desired” :slight_smile: pattern. Thks

q = [{
  {:"$1", :"$2", :"$3", :_},
  [{:orelse, {:==, :"$2", {:const, id}}, {:==, :"$3", {:const, id}}}],
  [{{:"$1", :"$2", :"$3"}}]
}]

with:

q =
   Ex2ms.fun do
        {ch, e, r, _} when e == ^id or r == ^id -> {ch, e, r}
   end