mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
where clause for one to many relationship #271
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 @seanliu1 on GitHub (May 21, 2019).
I am looking for something similar to [NSPredicate predicateWithFormat:@"person.children.@count > 0"]
I tried to use
dataStack.fetchAll(From().where(\person.children.count == 0)
but it will give error
Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value.
I wonder what is the correct syntax for this case?
@JohnEstropia commented on GitHub (May 23, 2019):
Sorry I haven't gotten to add this anywhere in the README yet, but this is the current syntax for it:
@seanliu1 commented on GitHub (May 23, 2019):
Thanks, I actually already figure out but not as elegant as yours.
I was using where(format: "episodes.@count == 0", argumentArray: nil) it also works, but it wont do any compile time check for your.
@Vertuals commented on GitHub (Nov 5, 2021):
@JohnEstropia What if we want a person from the list with a particular child id ?
what if we want a child from the list with a particular id ?
@JohnEstropia commented on GitHub (Nov 8, 2021):
@Vertuals Sorry, there are no syntax sugars for them in CoreStore yet, but you can use the
ANYandALLoperators in your ownNSPredicateand pass it to the CoreStorewhere()clause