Let's imagine you are storing a list of items in the Google Cloud DataStore. Each item has a list of sub-items (list of features) and sub-sub-items (list of infos each with a list of attribute-key).
[
{
"key": "product_1234",
"name": "Bio-Tofu",
"features" : {
"country": "Germany",
"currency": "Euro"
},
"infos": {
"info_A": {
"attr_A": "key_A",
"attr_B": "key_B",
"attr_C": "key_C",
},
"info_B": {
"attr_D": "key_D",
}
}
},
{
"key": "product_6789",
"name": "Bio-Soya-Dring",
"features" : {
"country": "Austria",
"currency": "Euro"
},
"infos": {
"info_A": {
"attr_A": "key_A",
"attr_E": "key_E",
},
"info_C": {
"attr_F": "key_F",
}
}
}
]
Question: Is there any way to retrieve all 'infos' or all 'attribute-key' pairs of all items (products) at once? What I want to retrieve is for instance:
{
"attr_A": "key_A",
"attr_B": "key_B",
"attr_C": "key_C",
"attr_D": "key_D",
"attr_E": "key_E",
"attr_F": "key_F",
}
or
infos: [
"info_A",
"info_B",
"info_C"
]
The reason why I'm trying to do this is, that I want to create a Pandas DataFrame (Pivot-Table) having the infos or features as columns and the items as rows. I could just read all of the items and create the list of features and infos in Python code, but maybe there's SQL way to ask Google Cloud Storage to give me that list (subset, union, or whatever you name it)?
Thanks for any hint.