Skip to content

Instantly share code, notes, and snippets.

@damonvjanis
Last active December 5, 2018 21:36
Show Gist options
  • Save damonvjanis/b777c3102a596056c82710b9a6e89ee2 to your computer and use it in GitHub Desktop.
Save damonvjanis/b777c3102a596056c82710b9a6e89ee2 to your computer and use it in GitHub Desktop.
Uses lists to do a matching comparison on big datasets
for lead <- leads do
matching_contacts = Enum.filter(contacts, fn c -> c["email"] == lead["email"] end)
# Return a tuple with the lead and any contacts that match
{lead, matching_contacts}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment