如何在realm.object()中传递引用变量.filtered()

时间:2017-07-13 11:24:42

标签: react-native realm

我想使用realm api搜索数据库,我找不到任何传递变量的方法

 let filterOpenRecord =  realm.objects('RepleteMedicalCondition').filtered('codeDescription = "`${this.state.MCDescription}`" AND closed = false');

1 个答案:

答案 0 :(得分:0)

您可以执行类似

的操作
 let filterOpenRecord =  realm.objects('RepleteMedicalCondition').filtered('codeDescription = $0 AND closed = false', this.state.MCDescription);