繁体   English   中英

OrientDB查询子

[英]Orientdb query child

Orientdb 2.1.11(文档数据库)是否有办法获取EmebeddedList

这是课程结构

{
    "@class":"Quote",
    "number":"Q1",
    "details":[{
      "code":"123",
      "price":10
      },{
      "code":"456",
      "price":20
      }
    ]
},{
    "@class":"Quote",
    "number":"Q2",
    "details":[{
      "code":"789",
      "price":15
      },{
      "code":"951",
      "price":25
      }
    ]
}

我想要一个查询,它将返回以下内容:

number| code | price
------|------|------
Q1    | 123  | 10
Q1    | 456  | 20
Q2    | 789  | 15
Q2    | 951  | 25

我已经复制了您的结构

在此处输入图片说明

我已经使用了这个查询

select number, details.code as code, details.price as price from (select prop.number as number, prop.details as details from (select prop from test unwind prop) unwind details)

在此处输入图片说明

希望能帮助到你

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM