Deletes the array element with specified index (negative integers count from the end). Throws an error if JSON value is not an array.
'["a", "b"]'::jsonb - 1 → ["a"]
jsonb#-text[] → jsonb
Deletes the field or array element at the specified path, where path elements can be either field keys or array indexes.
'["a", {"b":1}]'::jsonb #- '{1,b}' → ["a", {}]
Regards
I have looked at the docs, but it doesn't, AFAIU, show how to conditionally delete a key based on its value, and leave other keys in the JSONB not matching the value alone.
I want to delete all keys in the (pseudo) path details.keyInformation[*].dunsNumber if the value is "NaN".