Request must contain at most 16 paths

When I’m trying to mutate documents fields more than 16 I get Request must contain at most 16 paths error, How I’m supposed to mutate fields more than 16.

InvalidArgumentError: invalid argument
    at _getWrappedErr (E:\project\####\node_modules\couchbase\lib\errors.js:820:14)
    at Object.wrapLcbErr (E:\project\####\node_modules\couchbase\lib\errors.js:1009:20)
    at E:\project\####\node_modules\couchbase\lib\collection.js:1211:24 {
  cause: LibcouchbaseError { code: 203 },
  context: KeyValueErrorContext {
    status_code: 203,
    opaque: 0,
    cas: CbCas { '0': <Buffer 00 00 00 00 00 00 00 00> },
    key: 'test-edit',
    bucket: 'ads',
    collection: '',
    scope: '',
    context: 'Request must contain at most 16 paths',
    ref: ''
  }
}

mutation code

function update(id, document) {
  return new Promise((resolve, reject) => {
    const upsert = Object.keys(document).map(function (key) {
      return couchbase.MutateInSpec.upsert(key, document[key]);
    });

    collection.mutateIn(id, upsert, (error) => {
      if (error) reject(error);
      else resolve({ id });
    });
  });
}

Hey @chawki,

There is a hard limit of 16 sub-document mutations per mutation operation. Ideally you might condense a number of the operations together if possible (if a number of keys mutate an entire sub-document), or you may need to revert to using a CAS swap instead.

Cheers, Brett