Skip to content

Saved Query partial update of nested array #103

@masojus

Description

@masojus

Investigate what happens when trying to do an update of a Saved/Cached Query definition such that an element in a nested array is the target of the update. Filters, Funnel Steps and Group By parameters come to mind.

I suspect that right now this works if your target update is the entire array, and you set an entire new List<Map<String, Object> as Filters or Funnel Steps, or a List<String> as Group By params. Ideally one could pass a List<Filter> or List<FunnelStep> or something, but that seems like a lot of work. Right now I think when it sees the List<> as something that's not a Map<> it'll stop there and set it as the new property.

Additionally, you really probably just want to change a single property in a particular element in the list, so maybe only the filter op of the 2nd of 3 filters needs to change from gt to gte so how to express that? If this were a realistic scenario, one would send something like this as the conceptual partial update:

{
  "query": {
    "filters": [
      null,
      {
        "operator": "gte",
      }
      null,
    ]
  }
}

Really, this sort of nested complex update is probably A) not common, B) even less likely to happen in a scenario also involving remote collaborative changes to the same query, which is the source of part of the problem solved by partial updates--to not lose remote changes, and therefore C) better handled by just re-creating the query definition from scratch (which avoids dealing with disallowed properties being sent, like last_modified_date and friends).

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions