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

Allow searching list of type map in where clause

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.0.0
    • Fix Version/s: 5.0.1
    • Labels:
    • Environment:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated: