다음 쿼리를 수행하고 있습니다.
realm.objects('Maker').filtered("categories CONTAINS $0", categoryObject)
하지만이 오류가 발생합니다.
Only 'equal' and 'not equal' operators are supported for object comparison
그리고 여기 내 스키마가 있습니다.
{
name: 'MakerOption',
primaryKey: 'serverId',
properties: {
serverId: 'int',
name: 'string',
categories: {type: 'list', objectType: 'Category'},
}
{
name: 'Category',
primaryKey: 'serverId',
properties: {
serverId: 'int',
name: 'string'
}
이 주제에 대한 문서는 매우 드뭅니다. 이 작업을 수행하는 다른 방법이 있습니까?
링크 된 객체 나 자식 객체에 대한 속성 별 필터링은 쿼리에 키 경로를 지정하여 수행 할 수 있습니다.
car.color == 'blue'
따라서 다음 쿼리를 찾고 있습니다.
realm.objects('Maker').filtered("categories.serverId == $0", categoryObject.serverId)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다