A match specification turns an ETS query into a structured operation that filters rows in ETS memory and controls which fields are returned. This avoids copying every table row into the selecting process and supports richer queries than basic match patterns. section 10.3.3
A specification contains three parts:
- Head: a match pattern describing the rows to select. section 10.3.3
- Guard: additional filters applied to matching rows. section 10.3.3
- Result: the shape of the data returned. section 10.3.3
iex(6)> :ets.match_object(todo_list, {:_, "Dentist"})
[{~D[2023-05-24], "Dentist"}, {~D[2023-05-30], "Dentist"}]
Use match_object/2 for a simpler row-pattern query; move to a full specification when filtering or returned fields become more selective. section 10.3.3
