DBObject到gson ISODate格式

时间:2017-12-05 09:10:54

标签: java mongodb gson

我正在尝试从提取的data中读取属性。 data这里是object。 代码看起来像DBObject invoiceGenerationObject = invoiceGeneration.findOne(findOneByInvoicveGenerationId);

invoiceGenerationObject holds data like this 
{
  "_id": {
    "$oid": "5a16b4d1ee18edcb5bad74d0"
  },
  "invoiceGenerationId": "700051",
  "facilitiesSelected": [
    "10013",
    "12345"
  ],
  "invoicingMonths": [
    "2017-03",
    "2017-04"
  ],
  "monthsGenerated": [],
  "facilityMonthDetails": [
    {
      "generate": true,
      "nextInvoiceDate": "2017-04-01T00:00:00.000Z",
      "total": 268
    }
  ],
  "generateInvoiceTill": "Oct-2017",
  "invoicing": [
    {
      "scriptName": "Unallocating Future Payments",
      "status": "Completed",
      "startTime": {
        "$date": "2017-11-29T09:22:33.281Z"
      },
      "endTime": {
        "$date": "2017-11-29T09:22:33.302Z"
      }
    }
  ],
  "invoices": [],
  "modifiedDate": {
    "$date": "2017-11-29T09:22:33.302Z"
  }
}

如何访问invoicing

0 个答案:

没有答案