Hi there,
I’m coding for a requirement using Aggregation Framework to detect whether an array as a field of a parent nested array element contains at least one common element from an external array provided through the method parameter String[] externalArray
. The schema of the document is like the following:
{
"fields_v" : [ {
"value" : [ txt ]
} ]
}
I attempted to use array (as set) intersection and check if the resulting set is empty to resolve it. But as I had looked through the document, it seems the SetIntersection operator can only handle intersections of arrays already as fields, no way to access an external array. Is there any workaround or did I miss something? Any help is much appreciated, thanks!