如何在 ReamDB 中的同一对象中获取两个属性,一个具有值,另一个仅具有属性名称?

问题描述

用 RealmDB 对象如何写多键查询? 架构部分:

StudentSchemaNames.student_data = { classID: int,student: 学生[],noOfPresence: int,noOfabsence: int,noOfLeft: int };

StudentScehmaNames.students = {studentid:int,studentfirstName: string:,studentlastName:string}

我有一个像;

studentDetails = [{"classID": "001","students": [Array],"noOfPresence": 30,"noOfabsence": 2,"noOfLeft": 9}];

目前我正在获取有关 studentId= 001 的详细信息;

studentDetails = await RealmDB.get(StudentSchemaNames.student_DATA,studentId="${studentId}" AND 'noOfPresence');

这里的学生 ID 属性通过值和 noOfPresence 传递,只有属性名称和要执行的查询中没有值。

但我想写这样的查询; 场景 1:根据学生 ID 取值和 NoOfPresence only 属性获取数据 场景 2:仅使用学生 id 值获取学生属性的数据基础 场景 3:仅以学生 id 值获取基于类属性的数据

帮助我使用 RealmDB 为上述场景编写查询。提前致谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...