I don’t know if there is a word for this, I think it is, but right now I couldn’t explain it better than “where the array contains elements from the array”.
It may sound weird, but actually it is not (I think), and it is difficult for me to understand how I can do this in Azure CosmosDB.
Here it is. I have a document like this (simplified):
{
"id": "2a62fcf4-988f-4ebe-aedc-fb0c664b85d8",
"Title": "Seks års fængsel for overgreb",
"ZipCodes": [
{
"Code": "6500",
"Name": "Vojens",
"FoundViaTerm": "Vojens"
},
{
"Code": "6400",
"Name": "Sønderborg",
"FoundViaTerm": "Sønderborg"
},
{
"Code": "6700",
"Name": "Esbjerg",
"FoundViaTerm": "Esbjerg"
}
],
"_rid": "k1sVAPf7SQAMAAAAAAAAAA==",
"_self": "dbs/k1sVAA==/colls/k1sVAPf7SQA=/docs/k1sVAPf7SQAMAAAAAAAAAA==/",
"_etag": "\"00001000-0000-0000-0000-5a14898e0000\"",
"_attachments": "attachments/",
"_ts": 1511295374
}
Ok, now I want to request documents like these and find everything where ZipCodes.Code is in the list of zip codes, e.g. ("6500", "2700").
I'm a mystery here ...
I found the ARRAY_CONTAINS method , and it works if I enter with only one zip code - my problem is that I came with a list.
, - , .