Hi Jens,

I have a question that already posted on Github but it's not a right place 
for ask question, show i move it to this:

Hi,

I'm finding the way to find inverse a to-many relation. Just read #606 and 
also Wiki about Inverse Relation but seem that it doesn't fits my situation.

I have Customer and CustomerGroup class. Customer class have a array of 
CustomerGroup. How can i get all Customer that belong to CustomerGroup.

```
class Customer: BaseCBLObject {
    @NSManaged
    var groups: [CustomerGroup]

    class func groupsItemClass() -> AnyClass {
        return CustomerGroup.self
    }
}
```
```
class CustomerGroup: BaseCBLObject {
    @NSManaged
    var allCustomers: [Customer]

    class func allCustomersItemForClass() -> AnyClass {
        return Customer.self
    }
    
    class func allCustomersInverseRelation() -> String {
        return "groups"
    }
}
```

Currently if i have CustomerGroups instance `group` then get all customer 
by call `group.allCustomers` or explicit call 
`group.findInverseRelation:fromClass` it will return empty array.

Thanks

--------
* Version:   1.2
* Client OS: 9.x
* Server:    4.0

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/0cc7dc0c-6557-4ee0-b32a-3acbcafb1bd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to