Skip to content

Instantly share code, notes, and snippets.

@smoak
Created January 13, 2012 22:53
Show Gist options
  • Save smoak/1609211 to your computer and use it in GitHub Desktop.
Save smoak/1609211 to your computer and use it in GitHub Desktop.
for (f in dbPerson.family) do
// try and find the fm in the api
foundFm = null
for (apiFm in apiPerson.family) do
if apiFm == f then
foundFm = apiFm
break
end
end
if foundFm != null then
// merge
else
// delete
end
end
// now what about inserts? maybe this will do?
for (apiFm in apiPerson.family) do
foundFm = null
for (dbFm in dbPerson.family) do
if apiFm == dbFm then
foundFm = dbFm
break
end
end
if foundFm == null then
// insert apiFm
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment