-record(rule, {id, low, high}).
test_ets() ->
ets:new(rule_table,[named_table,public,bag]),
ets:insert(rule_table, #rule{id=1, low=2, high=5}),
ets:match_object(rule_table, [{'$1',[{'>=', {element, #rule.low, '$1'}, 2},
{'=<', {element, #rule.high, '$1'}, 5}
], ['$_']}]).
This function only get an empty list while I want to pick this record with low =< X =< high.
Please help me. Thank you
I'm wrong, use ets:select instead.
But how is the performance using matchSpec? Is it all table scan?