How to read all the records of mnesia database in erlang?
I ma new in erlang and I need to do some operations for all records I get from mnesia database. Result = mnesia:dirty_read(mydatabase, {key1, key2}), case Result of [] -> ?DEBUG("No such record found", []); [#mydatabase{key3 = Key3}] -> %% some operations end How can I add a loop to my code that execute some operations for all records? I am not even sure if the code above does it or not? You could use mnesia:foldl/3 for that. It iterates over all records in a table, passing along an "accumulator" value. It doesn't have an explicit "dirty" counterpart, so if you want to run it as a dirty