Couchbase 2.2.0 document size editing limit

▼魔方 西西 提交于 2019-11-29 22:16:33
Stavros Aloizos

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.

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

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.

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?

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

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

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

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

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