Couchbase 2.2.0 document size editing limit

≯℡__Kan透↙ 提交于 2019-11-28 17:28:25

问题


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 allowed

How can I increase max editing document size?


回答1:


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.




回答2:


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



回答3:


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.




回答4:


Couchbase console is here to help you, but when you deal with large data it is better to use a SDK and modify your document using some code. You can find all the SDKs here: http://www.couchbase.com/develop

Is is possible with your environment?




回答5:


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




回答6:


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




回答7:


As of Couchbase 4.5 you have to modify the app.min.js file not the documents.js. To permanently fix try:

sed -i 's|return getStringBytesFilter(json)>docBytesLimit;|return false;|' /opt/couchbase/lib/ns_server/erlang/lib/ns_server/priv/public/ui/app.min.js




回答8:


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



来源:https://stackoverflow.com/questions/19090611/couchbase-2-2-0-document-size-editing-limit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!