Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DocumentClientException "Request size is too large"

I have created JSON that byte.length is too large, and when I try to use the api java:

documentClient.createDocument(
                    getTodoCollection().getSelfLink(), document, null,
                    false)

returns an

DocumentClientException: Message: {"Errors":["Request size is too large"]}

Is there any way to save this kind of files in the documentDB?

like image 204
mitchell.p Avatar asked Aug 13 '15 10:08

mitchell.p


1 Answers

From DocumentDB limits and quotas page, maximum size of a document can be 512 KB 2 MB. If your JSON size is more than that, you will get this error.

If the size of your document is more than 512 KB 2 MB, then you can't save the document as is in DocumentDB. One thing you could do is save the JSON in Blob Storage as a block blob and save the Blob URL in DocumentDB.

P.S. For some reason I thought the size of an attachment in DocumentDB is 2 MB and I thought of suggesting that but it seems they have changed it to 512 KB as well.

like image 178
Gaurav Mantri Avatar answered Oct 05 '22 23:10

Gaurav Mantri