我有以下Realm对象
class Patient: Object {
@objc dynamic var name: String?
let list = List<RString>()
}
class RString: Object {
@objc dynamic var stringValue: String?
}
我需要使用Patient
RString
个组件的stringValue = "test"
个对象
这样的事情可能吗?
patients = realm?.objects(Patient.self).filter("name = 'name1' AND @% IN list", RString(stringValue: 'test'))
答案 0 :(得分:2)
您需要使用SUBQUERY
才能访问List
中NSPredicate
元素的属性。 SUBQUERY
会为true
个Patient
个属性至少包含list
个RString
元素的stringValue
元素String
评估patients = realm?.objects(Patient.self).filter("name = %@ AND SUBQUERY(list,$element,$element.stringValue == %@).@count>0", "name1", "test")
const simpleParser = require('mailparser').simpleParser;
simpleParser(data.Body, (err, mail)=>{
if(err){
console.log(err)
callback(null, null);
}else{
console.log(mail)
console.log(mail.attachments[0])
console.log(mail.attachments[0].content)
console.log(mail.attachments[0].content.toString('ascii'))
callback(null, null);
}
})
}。
set "KERAS_BACKEND=tensorflow"