Document reached max size exception

Hi,

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?

Thanks.

Hi, please check out the javadoc for the mutation methods: http://docs.couchbase.com/sdk-api/couchbase-java-client-2.2.1/com/couchbase/client/java/Bucket.html#insert-D-

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());
    bucket.insert(doc);