I'm doing the following query:
realm.objects('Maker').filtered("categories CONTAINS $0", categoryObject)
But I'm getting this error:
Only 'equal' and 'not equal' operators are supported for object comparison
And here's my schema:
{
name: 'MakerOption',
primaryKey: 'serverId',
properties: {
serverId: 'int',
name: 'string',
categories: {type: 'list', objectType: 'Category'},
}
{
name: 'Category',
primaryKey: 'serverId',
properties: {
serverId: 'int',
name: 'string'
}
The documentation is quite sparse on this subject. Is there an alternative method for doing this?
Filtering by properties on linked or child objects can be done by specifying a keypath in the query e.g.
car.color == 'blue'
So you are looking for the following query:
realm.objects('Maker').filtered("categories.serverId == $0", categoryObject.serverId)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With