Document reached max size exception


I tried to find a specific exception when document is reached to the max size (20MB) but didn’t found it in the documentation.
Is there any specific exception for such case in the Java SDK?


Hi, please check out the javadoc for the mutation methods:

It says “The request content is too big: RequestTooBigException” - and here is how you can verify that:

   Cluster cluster = CouchbaseCluster.create();
    Bucket bucket = cluster.openBucket();

    long length = 1000*1000*21;
    StringBuilder outputBuffer = new StringBuilder();
    for (long i = 0; i < length; i++){
        outputBuffer.append(" ");

    Document doc = StringDocument.create("tooLarge", outputBuffer.toString());