Delete redundant fields

How is possible to delete all redundant fields?
Assume in the following document

{
"a": 1,
"b": 2,
"c":3,
"d": 1,
...

We want to remove all fields except a and c

Use UPDATE

UPDATE default AS d SET d = {d.a, d.c} 
WHERE ....;