[erlang-questions] Selecting records from Mnesia using partial key

Frans Schneider <>
Fri Jul 6 13:34:40 CEST 2018


Dear list,

Before trying to reinvent the wheel, maybe somebody can point me in the 
right direction.

I have a request with a variable set of attributes [A, B, C...] and a 
Mnesia table with policies, each applicable for a also variable set of 
attributes [X, Y, Z...]. Policies may be applicable for the same set of 
attributes, in which case all these policies have to be evaluated.

A policy should be selected if its attributes is the set _or a subset_ 
of attributes from the request: i.e. if the request has the set of 
attributes [A, B] than all policies with attributes [A, B], [A] and [B] 
should be selected.

Attributes currently are records holding two strings but could be turned 
into atoms.

Does anybody know a nice way to implement this in Mnesia?

Thanks,

Frans


More information about the erlang-questions mailing list