Uploaded image for project: 'Hibernate ODM'
  1. Hibernate ODM
  2. HIBERNATE-77

implement $in and $nin comparison operator

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Suppose for the following entity which contains an array field (`tags`):

      @Entity
      @Table(name = "movies")
      public class Movie {
          @Id
          int id;
          String title;
          List<String> tags;
      }

      When it comes to array filtering, we have at least two options:

      • array function
      • HQL's `in` and `not in` feature

      https://jira.mongodb.org/browse/HIBERNATE-63 has been created to implement two basic functions.

      This PR aims to solve the second option. For instance, the following HQL should work as expected (internally it could be translated into comparison operator using `$in` and `$nin`):

      from Movie m where :tag in m.tags

      or

      from Movie m where :tag not in m.tags

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            nathan.xu@mongodb.com Nathan Xu
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: