orientdb - 如何在 orientDb 中查询带边的类?

标签 orientdb

enter image description here

我的问题是,我如何查询“聊天”表以检索个人资料表中的人员详细信息。

ParticipatinIn edge 从 Person 开始聊天。 HasProfile Edge 开始了个人资料。

请帮我解决这个问题..

谢谢

最佳答案

我用过这个结构

enter image description here

您可以使用这样的查询:

select name, person.name, person.out("hasProfile").name as profile from (select name, in('ParticipatinIn') as person from Chat unwind person) unwind profile

enter image description here

如果你使用遍历,如果一个人是两个不同 Chat 的一部分,你只会得到那个人一次。

希望对您有所帮助。

关于orientdb - 如何在 orientDb 中查询带边的类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37585048/

相关文章:

java - OrientDB - 数据库对象与当前线程不同步

gremlin - 仅考虑属性名 = 值的顶点,找到 2 个顶点之间的所有路径

java - 如何使用 Java 在 OrientDB 中使用批处理

orientdb - 如何更改orientdb中的输入类型

sql - 用于多个字段上的键集分页的通用 SQL 谓词

node.js - OrientJS:将二进制数据与 "normal"属性一起存储

c# - 如何在 OrientDB .Net API 中执行 Massiveinsert?

database-connection - ODatabaseException : Database instance is not set in current thread

node.js - 使用 Sails.js 和 OrientDB 进行多边建模