の分私のJSONデータ取得:DocumentDBはサブアレー
[
{
"Code": "GB-00001",
"BasicInformation": {
"WGS84Longitude": -4.670000,
"WGS84Latitude": 50.340000
},
"Availability": [{
"ArrivalDate": "2017-04-21",
"Price": 689
},
{
"ArrivalDate": "2017-04-28",
"Price": 1341
}
]},
{
"Code": "GB-00002",
"BasicInformation": {
"WGS84Longitude": -4.680000,
"WGS84Latitude": 50.350000
},
"Availability": [{
"ArrivalDate": "2017-04-21",
"Price": 659
},
{
"ArrivalDate": "2017-04-28",
"Price": 1440
}
]}
}]
私はのようになり、結果が欲しい:
[
{
"HouseCode": "GB-00001",
"Country": "GB",
"location": {
"type": "Point",
"coordinates": [
50.340000,
-4.670000
]
}, "lowestPrice": 689
},
{
"HouseCode": "GB-00002",
"Country": "GB",
"location": {
"type": "Point",
"coordinates": [
50.350000,
-4.680000
]
}, "lowestPrice" : 659
}
私の問題は、次のとおりです。min(c.Availability.Price)
これを使用する方法私の現在の質問は、ポイントに変換するlat lngですが、最低/最低価格を取得する方法は考えていません。
SELECT c.Code, c.BasicInformation.Country ,
{"type":"Point","coordinates": [c.BasicInformation.Latitude, c.BasicInformation.Longitude]} as location
FROM c
はすでに、おそらく私は早すぎるよJoin c.Availability a
と, min(a.Price)
編集てみましたか? https://feedback.azure.com/forums/263030-documentdb/suggestions/18561901-add-group-by-support-for-aggregate-functions url in https://stackoverflow.com/a/42697673/169714
集計関数を使用するときにグループ化が不十分で、ユーザー定義関数を作成する必要があるため、min(a.Price)を使用できません。私は前にudfを使ったことがないので、私はそれを調べて、これに戻ります。あなたの答えをありがとう。編集:クラッシュhttp://imgur.com/a/hxoJ9 –
スクリーンショットは英語ではありません –
これは単なる通常のWindowsメッセージです。 DocumentDB.GatewayService.exeが機能しなくなりました。 –