Couchbase 2.2.0 document size editing limit

后端 未结 8 1133
离开以前
离开以前 2020-12-23 23:02

I tried to edit document via couchbase console, and caught this warning message:

Warning: Editing of document with size more than 2.5kb is not allowe

相关标签:
8条回答
  • 2020-12-23 23:26

    for Mac OSX, u can edit

    /Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/ns_server/erlang/lib/ns_server/priv/public/js/documents.js
    
    0 讨论(0)
  • 2020-12-23 23:27

    On Windows in Couchbase Server 3.0.3 this file is located at C:\Program Files\Couchbase\Server\lib\ns_server\priv\public\js

    0 讨论(0)
  • 2020-12-23 23:32

    It seems that the UI code will actually make the request and get the document back, but then refuse to show it if it's too big. So, you can actually just open up the browser developer tools, find the request for the document you want in the network traffic, and the document itself is right there in the response. Copy-paste into a pretty-printer, and you're done.

    0 讨论(0)
  • 2020-12-23 23:38

    You can raise the limit or disable completely on version 2.2:

    To raise the limit;

    edit file: /opt/couchbase/lib/ns_server/erlang/lib/ns_server/priv/public/js/documents.js

    at line 214:

    var DocumentsSection = {
    
      docsLimit: 1000,
    
      docBytesLimit: 2500,
    
    init: function () {
    
    var self = this;
    

    Edit the docBytesLimit variable set to 2500 and increase it to your preferred value.

    To disable completely;

    You can comment out the conditional statement and return a false value. At line 362 comment out the statement and return false:

    function isJsonOverLimited(json) {
      //return getStringBytes(json) > self.docBytesLimit;
      return false;
    }
    

    Hope this helps.. There are limitations as to how much your WYSYWIG editor can handle. So please be careful and as always editing core files can have negative results. We did it on our system and it works for us.

    0 讨论(0)
  • 2020-12-23 23:41

    If i read the code correctly it's seems like a hard code value in the UI code http://review.couchbase.org/#/c/22678/2/priv/public/js/documents.js

    0 讨论(0)
  • 2020-12-23 23:45

    Since couchbase 4.5 you need to update the following app.min.js file to view the documents larger than 2.5Kb.

    vi /opt/couchbase/lib/ns_server/erlang/lib/ns_server/priv/public/ui/app.min.js
    

    search for the word docBytesLimit within the file using below command. This will show you all the occurrences in highlighted color.

    /\<docBytesLimit/>
    

    Find the text constant("docBytesLimit",256*1024) within above occurrences and replace the 256 with the value you needed.

    Finally restart the couchbase server

    0 讨论(0)
提交回复
热议问题