ObjectPath nested query problem

2 views
Skip to first unread message

Nebi Aydin

unread,
May 12, 2025, 8:14:48 PM5/12/25
to ObjectPath
I have this expression string
expression_string = """
$..*[
    @.api_name is "X" and
    @.raw_record.event.parameters[@.name is "some_field" and @.value is "lala"] and
    @.raw_record.event.parameters[@.name is "some_field2" and @.value in ["val1", "val2", "val3", "val4"]]
]
"""
and my input is 
{
    # --- First record (should match) ---
    "api_name": "copy",
    "api_status": "Success",
    "breez_identity_type": "human",
    # ... other potential wrapper fields ...

    # --- Raw Google Workspace Event Record ---
    "raw_record": {
      "event": {
        "parameters": [
         
          {"name": "some_field", "value": "lala"}, # Matches criteria
          {"name": "other_field", "value": "random_val"},
        ],
      }
    }
}
but it doesn't match, any idea?
Reply all
Reply to author
Forward
0 new messages