Uploaded image for project: 'Spring Data MongoDB'
  1. Spring Data MongoDB
  2. DATAMONGO-2274

Enable SetIsSubset to be used for filtering condition in projection

    XMLWordPrintable

    Details

      Description

      Currently, this is what's required:

      and("props")
        .filter("prop", context -> 
         new Document("$setIsSubset", Arrays.asList("$$prop.valueSet", myList)))
        .as("props")
      

      There is no way to use SetIsSubset in this scenario because while SetIsSubset.arraySetSet(String arrayReference) works to point to the sub-property off of the filter (i.e., prop.valueSet), there is no way to do this:

      SetIsSubset
        .arraySetSet(String arrayReference)
      
        // This is not possible. Expects AggregationExpression or document property reference as array
        .isSubsetOf(List<String> arrayToCompareTo)

       

        Attachments

          Activity

            People

            Assignee:
            cstrobl Christoph Strobl
            Reporter:
            ychaikin Yaakov Chaikin
            Last updater:
            Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: