SELECT catalog.offerId, catalog.product.productId as productId, UNNEST childSkus.fee.chargefee as cf,ARRAY s FOR s IN catalog.product.childSkus
WHEN s.skuId IN [“sku8510261”] END AS childSkus
FROM idp_catalog
as catalog
use keys [“price::prod9220234”]
WHERE catalog.product.productId IN [“prod9220234”] and cf.commitmentTerm satisfies in [“NE24M50P”]
UNNEST can be used in FROM clause (it is join between document and array elements inside document).
SATISFIES needs to be used with ANY clause.
SELECT catalog.offerId, catalog.product.productId as productId, cf, sku AS childSkus
FROM idp_catalog AS catalog USE KEYS ["price::prod9220234"]
UNNEST catalog.childSkus AS sku
UNNEST sku.fee.chargeFee AS cf
WHERE catalog.product.productId IN ["prod9220234"] AND
sku.skuId IN ["sku8510261"] AND
ANY v IN cf.commitmentTerm SATISFIES v IN ["NE24M50P"] END;
SELECT catalog.offerId, catalog.product.productId as productId, cf, sku AS childSkus
FROM idp_catalog AS catalog USE KEYS [“price::prod9220234”]
UNNEST catalog.childSkus AS sku
UNNEST sku.fee.chargefee AS cf
WHERE catalog.product.productId IN [“prod9220234”] AND
sku.skuId IN [“sku8510261”] AND
ANY v IN cf.commitmentTerm SATISFIES v IN [“NE24M50P”] END;
In the above query i guess UNNEST sku.fee.chargefee AS cf is having some issue which is resulting in empty array. I tries removing this line and alaso refernces … i was able to retrive the response