Hi
Need help in writing a N1ql query and Index on how to fetch the subDocument with in the array whose intentId=“bd243aaf-ec21-4f53-8851-71c03e421662” nested deep under various keys?
Below is the sample document,
{
"gtin": "07312040150700",
"subClass": "W61DD",
"currency": "GBP",
"prices": {
"trn:xxx:seller:uuid:8252e530-36d3-41f4-8e41-02d9579368de": {
"48973981-9008-48ed-8571-b2d708f135d0": [
{
"prodId": "081882822",
"itemNumber": "081882822",
"intentId": "ad243aaf-ec21-4f53-8851-71c03e421662",
"effectiveDateTimeOffset": "Z",
"effectiveDateTime": 1649890800000,
"sellingUOM": "EACH",
"basePrice": "26.26",
"state": "APPROVED",
"createdDateTime": 1713801491892,
"updatedDateTime": 1721400805300,
"inheritedEffectiveDateTime": 1428879600000,
"gtinDeletionDate": 1428879600000
},
{
"prodId": "081882822",
"itemNumber": "081882822",
"intentId": "bd243aaf-ec21-4f53-8851-71c03e421662",
"effectiveDateTimeOffset": "Z",
"effectiveDateTime": 1749890800000,
"sellingUOM": "EACH",
"basePrice": "27.05",
"state": "APPROVED",
"createdDateTime": 1713801491892,
"updatedDateTime": 1721400805300,
"inheritedEffectiveDateTime": 1428879600000,
"gtinDeletionDate": 1428879600000
}
],
"18973981-9008-48ed-8571-b2d708f135d0": [
{
"prodId": "081882822",
"itemNumber": "081882822",
"intentId": "ad243aaf-ec21-4f53-8851-71c03e421662",
"effectiveDateTimeOffset": "Z",
"effectiveDateTime": 1649890800000,
"sellingUOM": "EACH",
"basePrice": "26.26",
"state": "APPROVED",
"createdDateTime": 1713801491892,
"updatedDateTime": 1721400805300,
"inheritedEffectiveDateTime": 1428879600000,
"gtinDeletionDate": 1428879600000
},
{
"prodId": "081882822",
"itemNumber": "081882822",
"intentId": "bd243aaf-ec21-4f53-8851-71c03e421662",
"effectiveDateTimeOffset": "Z",
"effectiveDateTime": 1749890800000,
"sellingUOM": "EACH",
"basePrice": "27.05",
"state": "APPROVED",
"createdDateTime": 1713801491892,
"updatedDateTime": 1721400805300,
"inheritedEffectiveDateTime": 1428879600000,
"gtinDeletionDate": 1428879600000
}
]
},
"trn:xxx:seller:uuid:8252e530-36d3-41f4-8e41-02d9579368db": {
"48973981-9008-48ed-8571-b2d708f135d0": [
{
"prodId": "081882822",
"itemNumber": "081882822",
"intentId": "cd243aaf-ec21-4f53-8851-71c03e421662",
"effectiveDateTimeOffset": "Z",
"effectiveDateTime": 1649890800000,
"sellingUOM": "EACH",
"basePrice": "25.00",
"state": "APPROVED",
"createdDateTime": 1713801491892,
"updatedDateTime": 1721400805300,
"inheritedEffectiveDateTime": 1428879600000,
"gtinDeletionDate": 1428879600000
},
{
"prodId": "081882822",
"itemNumber": "081882822",
"intentId": "dd243aaf-ec21-4f53-8851-71c03e421662",
"effectiveDateTimeOffset": "Z",
"effectiveDateTime": 1849890800000,
"sellingUOM": "EACH",
"basePrice": "22.00",
"state": "APPROVED",
"createdDateTime": 1713801491892,
"updatedDateTime": 1721400805300,
"inheritedEffectiveDateTime": 1428879600000,
"gtinDeletionDate": 1428879600000
}
],
"18973981-9008-48ed-8571-b2d708f135d0": [
{
"prodId": "081882822",
"itemNumber": "081882822",
"intentId": "cd243aaf-ec21-4f53-8851-71c03e421662",
"effectiveDateTimeOffset": "Z",
"effectiveDateTime": 1649890800000,
"sellingUOM": "EACH",
"basePrice": "25.00",
"state": "APPROVED",
"createdDateTime": 1713801491892,
"updatedDateTime": 1721400805300,
"inheritedEffectiveDateTime": 1428879600000,
"gtinDeletionDate": 1428879600000
},
{
"prodId": "081882822",
"itemNumber": "081882822",
"intentId": "dd243aaf-ec21-4f53-8851-71c03e421662",
"effectiveDateTimeOffset": "Z",
"effectiveDateTime": 1849890800000,
"sellingUOM": "EACH",
"basePrice": "22.00",
"state": "APPROVED",
"createdDateTime": 1713801491892,
"updatedDateTime": 1721400805300,
"inheritedEffectiveDateTime": 1428879600000,
"gtinDeletionDate": 1428879600000
}
]
}
},
"_class": "com.xxx.api.price.domain.entity.Price"
}
Regards,
Venkat