Incomplete documentation

What is options in MutateInSpec.remove

https://docs.couchbase.com/sdk-api/couchbase-node-client/MutateInSpec.html#.remove

I am looking for silence remove , Just don’t throw error if the field is no exist and remove it if exists

Hi @socketman2016
That is not supported with Sub-Document - if the field does not exist, then removing it will fail.

But you can work around it, by (in the same Sub-Document mutateIn), first upserting the field with a null value, and then removing it. That guarantees the field exists and that the remove will succeed.

2 Likes

Can you explain available options too?

@brett19 can you help with this?