Best practices for providing CoreData objects are unique based on entity attributes

What I'm trying to do is ensure the integrity of the objects on my graph. For example, none of the two users should have the same social security number.

Two solutions that I saw there:

1) index objects and find the corresponding objects using predicates before creating new objects

2) Create a dictionary in memory for each unique attribute of the entity.

iConfess: I come from the world of relational databases. I am a primary key user.

What is the best practice for what I'm trying to do.

+3
source share
1 answer

1: " ". , , ( ) , , , - , .

, , , , .

0

Source: https://habr.com/ru/post/1789786/


All Articles