I'm playing with map and filter and stuff, trying to do a functional way of removing an index from a map, like this:

({
  ([ "name": "user1",
        "val": "test",
        "random": "other"
  )],
  ([ "name": "user2",
        "val": "another test",
        "random": "something else"
  ]),
})

The array and mapping will be in that kind of format.  name is unique among all the map entries, and all the keys exist with all the maps.  I want to change it to something like this:

([ "user1": ([ "val": test", "random": "other" ]),
    "user2": ([ "val": "another test", "random": "something else" ])
])

I can get the keys for the new map with array[*]["name"].

But removing that key from the maps and leaving the others is giving me a problem.  Filter doesn't quite work because it only gives the value, and I'm not testing on the value, but the key.

A foreach would work, but I'm wondering if I can do something like:

mkmapping(a[*]["name"],map(a,lambda(mapping m) { filter(......something here

If anybody has any ideas that would be great...

thanks