我有一个json文件作为documentDB中的文档,我有一个这类文档的集合。我想查询集合以获取所有文档" unit" =" Hrs"。 sku和offerTermCode因产品而异,我无法了解所有产品。我不知道如何进行查询。有没有办法解决这个问题?提前谢谢!
更新:我想的另一种方法是在上传到documentDB之前修改json: 我反序列化json文件并获得每个产品的JToken类型。我在这种方法中的问题是如何更改" DQ578CGN99KG6ECF.HU7G6KETJZ"到我想要的字符串,如何将priceDimensions更改为没有键的列表 " DQ578CGN99KG6ECF.HU7G6KETJZ.2TG2D8R56U"
{
"DQ578CGN99KG6ECF.HU7G6KETJZ" : {
"offerTermCode" : "HU7G6KETJZ",
"sku" : "DQ578CGN99KG6ECF",
"effectiveDate" : "2017-02-28T23:59:59Z",
"priceDimensions" : {
"DQ578CGN99KG6ECF.HU7G6KETJZ.2TG2D8R56U" : {
"rateCode" : "DQ578CGN99KG6ECF.HU7G6KETJZ.2TG2D8R56U",
"description" : "Upfront Fee",
"unit" : "Quantity",
"pricePerUnit" : {
"USD" : "11213"
},
"appliesTo" : [ ]
},
"DQ578CGN99KG6ECF.HU7G6KETJZ.6YS6EN2CT7" : {
"rateCode" : "DQ578CGN99KG6ECF.HU7G6KETJZ.6YS6EN2CT7",
"description" : "Windows (Amazon VPC), hs1.8xlarge instance-hours used this month",
"beginRange" : "0",
"endRange" : "Inf",
"unit" : "Hrs",
"pricePerUnit" : {
"USD" : "1.2510000000"
},
"appliesTo" : [ ]
}
},
"termAttributes" : {
"LeaseContractLength" : "1yr",
"OfferingClass" : "standard",
"PurchaseOption" : "Partial Upfront"
}
}
}