关于动态对象的Couchbase查询(存储在java中的地图中)

时间:2016-10-04 10:43:11

标签: java couchbase

[
  {
    "_class": "com.netas.netmetriks.common.model.entity.WorkOrder",
    "failCount": 0,
    "id": "1",
    "messageType": "RESET_DCU",
    "ongoingWorks": [
      1
    ],
    "status": "IN_PROGRESS",
    "successCount": 0,
    "type": "workorder",
    "workOrderDetailMap": {
      "1": {
        "data": {
          "_class": "com.netas.netmetriks.common.model.converted.DeviceId",
          "manufacturerFlag": "DSM",
          "serialNumber": "87654321"
        },
        "dcuId": {
          "manufacturerFlag": "DSM",
          "serialNumber": "87654321"
        },
        "id": 1,
        "requestDate": "20160818114933",
        "resultDocuments": [],
        "status": "IN_PROGRESS"
      },
    "2": {
    "data": {
      "_class": "com.netas.netmetriks.common.model.converted.DeviceId",
      "manufacturerFlag": "DSM",
      "serialNumber": "87654322"
    },
    "dcuId": {
      "manufacturerFlag": "DSM",
      "serialNumber": "87654322"
    },
    "id": 2,
    "requestDate": "20160818114934",
    "resultDocuments": [],
    "status": "IN_PROGRESS"
     }
    }
  }
]

我只想获得“1”和“2”对象的内部。

我正在尝试获取数据,dcuId,id,requestDate,resultDocuments,status。

SELECT wd.* FROM netmetriks n
UNNEST workOrderDetailMap wd
WHERE  n.type = 'workorder' and n.id = '1'  ORDER BY n.documentId ASC LIMIT 10 OFFSET 0

我写了一个查询,但无法摆脱“1”和“2”。

HashMap在存储数据时用于实体,因此结果显示1,2,3,4等...

0 个答案:

没有答案