It's now possible to FILTER
or REJECT
an object by key and value. If you use a LAMBDA
function with two arguments, the first argument will be the key and the second argument will be the value. The original behaviour is unchanged: if the lambda takes a single argument, it will be the value. Use the two arguments if you need to check the key or both the key and the value.
For instance, you could get all the key/value pairs where the key begins with "public_key_" by running:FILTER(my_object, LAMBDA(key, value, SLICE(key, 0, 11) = "public_key_"))
Or you could reject any key/value pairs where the key includes the substring "meta" or the value is null
:
REJECT(my_object, LAMBDA(key, value, INCLUDES(key, "meta") || value = NULL))