I am trying to use Magical Record to import data into db CoreData .
I am working on a Person entity at the moment.
A Person has attributes firstName , lastName , personID . (I know that I do not need idString, I do not use it internally, it is used to talk to the server).
In any case, if I already have a person ...
firstName - John lastName - Smith personID - 1
And I load JSON ...
[ { firstName: John, lastName: Doe, id: 1 }, { firstName: Michael, lastName: Caine, id: 2 }, { firstName: Angelina, lastName: Jolie, id: 3 } ]
I want the import to add Michael and Angelina and update John Smith to John Doe , because it already exists with the same identifier vs personID.
I set mappedKeyName between id and personID.
Can this be done? I read this blog ... http://www.cimgf.com/2012/05/29/importing-data-made-easy/ about automatic matching of key names, etc .... and wondered if I could Do I use this to do what I want?
I read the about relatedByAttribute part from the blog, but I'm not sure where I should install it and what?
Should I set it on a Person object? Or the personID attribute? And what should I install? "I'd"? Or something else?