json - DocumentDb, how can I reduce the source to a smaller subset and output in a different shape when original document has no field names -
I have to follow the JSON string which is obtained from an external party stored in Windows Azure DocumentDb:
< "12345", "Lines": [["20140925", "762", "12345", "Profile ID:" "12345", "Account Id": ">" ], ["20140 9 26", "552"],]}I want to reduce the source to a small set and output in a different shape.
< P> "SELECT * FROM" yield yield: [["20140 925", "762"], ["20140 9 26", "552"],]] < / Code>
the question is why I do not have field names, how can I modify the output as mentioned in the document document document as "SELECT {date": "," "value":}} syntax?
< P>
I think you are looking to see your data in such a way: < In that case, you can get the join / Code> Use to repeat through section Use the
VALUE
keyword to draw the date and value values from the children of your document ( rows
), and then query the query.
Here is the query I used to generate the above result:
SELECT VALUE {'date': r [0], 'value': r [1]} from the collection C.rows WHERE c .kind = "data" in
Hope this will answer your question :)
Comments
Post a Comment