mnesia query for list membership?

Edwin Young <>
Wed Dec 16 17:31:27 CET 1998


Hello,

I tried the following, but I got an impenetrable error message (which I don't have with me: sorry).
Any suggestions?

-record(document, {id
            title}).

docs(Term) ->
    Fun = fun() -> 
        Q = query [ D.title || D <- table(document),
            lists:member(1,[1]) ]
        end,
        mnemosyne:eval(Q)
    end,
    mnesia:transaction(Fun).

If I replace the list check with (say) D.id /= 0, it works fine. If I can't call standard functions inside
a query, how should I do this? Post-filter the result list?

Thanks a lot,

--
Edwin

PS Great language, BTW!




More information about the erlang-questions mailing list