简体   繁体   English

OrientDB查询子

[英]Orientdb query child

Is there a way with Orientdb 2.1.11 (document database) to get the EmebeddedList Orientdb 2.1.11(文档数据库)是否有办法获取EmebeddedList

Here is the class structure 这是课程结构

{
    "@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
      }
    ]
}

I would like a query that will return the following : 我想要一个查询,它将返回以下内容:

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

I have replicated your structure 我已经复制了您的结构

在此处输入图片说明

and I have used this query 我已经使用了这个查询

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)

在此处输入图片说明

Hope it helps 希望能帮助到你

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

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