**Background:**
I have two tables within a CosmosDB database that hold key:value documents within their containers.
T1 and T2
T1
Id: 111
ems_featurecategory: 1234
ems_name: "win"
T2
feature_category: "win"
feature_category: "hello"
I wish to query cosmosdb so that I:
Return the value from T1 ems_featurecategory key if the ems_name value from T1 matches the feature_category value from T2.
**Desired Output:**
So since the ems_name key's value from T1 matches the featurecategory's key's value from T2
ems_name: "win"
featurecategory: "win",
the value that will be returned will be: 1234
**My approach:**
JOIN the two tables and perform a query such as:
SELECT c.emsfeaturecategory, c.ems_name, f.feature_category
FROM c
JOIN f in c.id
WHERE array_contains(['',''],c.id,true)
AND c.ems_name = featurecategory...
I am not sure how to write this query out successfully. Any suggestions or advice is helpful.


Report
All responses (
Answers (