If I have the following set of documents:
{
"name": "1foo",
"skus": {
"1234": ["1234","abcd"],
"5768": ["5678","efgh"]
}
},
{
"name": "2baz",
"skus": {
"1111": ["1111","aaaa"],
"2222": ["2222","bbbb"]
}
}
What I’d like to be able to do is query for, say, “2baz” given the sku “bbbb”.
If I create an array of objects in the skus, it’s fairly trivial to do, but that feels verbose. If that’s what I need to do, that’s fine, but I’d like to avoid it if I can; I cannot figure out how to get this unwrapped such that I can just query it. An aggregate would be fine, but I haven’t been able to figure out the aggregation either.