Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-8594

AND condition is not working within Objects/List of Objects in DI query

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Data Index
    • None
    • False
    • None
    • False
    • ---
    • ---

      Refer to issue:

      AND condition is not working within Objects/List of Objects in DI query · Issue #1614 · kiegroup/kogito-apps (github.com)

      My requirement is - I have a process which contains an Array. I want to filter the process based on $elemMatch (used in Mongo Db) in an array. Is there a way I can query Array in DI.
      If I use containsAny or Contains - the DI query is giving random results (not exact match).

       

      Sample DI Query:
      query commentsearch{

      Comments(where:
      {commentary:
      {commentList:
      commentCategoryCode:{equal:"RESOLVE_NOTES"},
      commentText:{like:"comment"}}}{

      commentary {
      commentList

      { commentCategoryCode commentText }

      }

      }

       

      DI Response:

      {

      "data": {

      "Comments": {

           "commentary": {

               "commentaryList": [

           

      { "commentCategoryCode":"RESOLVE_NOTES",        "commentText": "<p>test text</p>" }

      ,

      {  "commentCategoryCode": "NOTES",
          "commentText": "<p>comment 123</p>" }

           ]

         }

        }

      }

      }

      Expected Result:

      • No Result should have been retrieved.(Since there was no data matching in Resolve_notes)
      • get all the commentary objects where commentCategoryCode is RESOLVE_NOTES and commentText is like "comments"

      Actual Result:
      getting results even if commentText is matching in commentCategoryCode = "NOTES"

      Note: In this example, we have 2 types of commentCategoryCode - RESOLVE_NOTES and NOTES

              nmirasch@redhat.com Neus Miras Chueca
              prerna.bhardwaj15 Prerana Bhardwaj (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: