Add and Remove Document From Nested Document

You can use OBJECT constructs, ARRAY constructs, OBJECT functions, ARRAY functions
https://developer.couchbase.com/documentation/server/current/n1ql/n1ql-language-reference/objectfun.html
https://developer.couchbase.com/documentation/server/5.0/n1ql/n1ql-language-reference/arrayfun.html

If you are looking update checkout Update Array of object's when object.name is present, if not present add object to Array