Uploaded image for project: 'Apache MetaModel (Retired)'
  1. Apache MetaModel (Retired)
  2. METAMODEL-1172

Allow searching list of type map in where clause

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.0.0
    • 5.3.0
    • Linux

    Description

      I have schema like “_id”,"address","borough","cuisine","grades".

      Where grades is list of maps with elements like

      [Document{{date=Fri May 14 05:30:00 IST 2021, grade=A, score=12.0}}, Document{{date=Wed Aug 13 05:30:00 IST 2025, grade=A, score=12.0}}, Document{{date=Sun Apr 04 05:30:00 IST 2027, grade=A, score=12.0}}] 
      

      Now if I execute query like

      DataSet ds = mongo.executeQuery("select * from restaurants where grades[0].grade='A'"); 
      

      Its failing at line 427 of MongoDbContext class final Column column = item.getSelectItem().getColumn();

      Update: But the real issue is not MongoDB specific. We just don't (yet) support traversing list/array objects like this. We support it with key/value maps, and even also when their values are list/array types, but not when the outer most type is a list/array.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              AnandRai AnandRai
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m