mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
How to delete everything that was not part of the result of importUniqueObjects?
#183
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kevinrenskers on GitHub (Oct 25, 2017).
When I am importing objects from my remote server, I have something like this:
So first I import the unique objects, then delete everything that wasn't part of this new collection. This used to work great! However now that I refactored to use CoreStoreObject, it's always removing all objects. Apparently this Where clause does not work properly when used with CoreStoreObject.
Is there a way to get the same functionality working with CoreStoreObject?
@kevinrenskers commented on GitHub (Oct 25, 2017):
Would I have to fetch all primary keys? I don't use a consistent property name for that though (like giftId, userId, etc) so I don't know how I would make that work?
@kevinrenskers commented on GitHub (Oct 25, 2017):
Solved my own problem:
@JohnEstropia commented on GitHub (Oct 26, 2017):
@kevinrenskers You may also want to use the
!operator onWhere:I recommend that you go through the README first. It's long but you'll find a lot of convenient way for common tasks.