3

I used CouchBase NodeJS SDK 2.6.10 previously and setting operationTimeout was something like this:

const couchbase = require('couchbase')

var cluster = new couchbase.Cluster('couchbase://XXXXXXXXXXXXXXXXXXX');

cluster.authenticate('USERNAME', 'PASSWORD')

var bucket = cluster.openBucket('statistics')

**bucket.operationTimeout = 3600000**

But, now in SDK 3.0.4, it's a bit different, like:

const couchbase = require('couchbase')

const cluster = new couchbase.Cluster('couchbase://XXXXXXXXXXXXXXXXXXX', {

    username: 'USERNAME',

    password: 'PASSWORD'

})

const bucket = cluster.bucket('statistics')

const collection = bucket.defaultCollection()

Here, I'm not finding any option to set operationTimeout from. Does anybody know anything about it?

Matthew Groves
  • 25,181
  • 9
  • 71
  • 121
Avishake
  • 460
  • 1
  • 6
  • 20
  • This question was also posted to the Couchbase forums, and there is some discussion there: https://forums.couchbase.com/t/how-to-set-operationtimeout-in-couchbase-nodejs-sdk-3x/26527/2 – Matthew Groves Jun 23 '20 at 18:43
  • 1
    Yes Sir, I posted there. The same question I have also posted in Yahho answers: https://in.answers.yahoo.com/question/index?qid=20200623063905AAHBol1 – Avishake Jun 24 '20 at 18:48

1 Answers1

0

I can see they have timeout options for their latest nodejs sdk 3.1 but not for v3.0

api ref: https://docs.couchbase.com/sdk-api/couchbase-node-client/Cluster.html

Posting from the thread mentioned by Matthew.

For v3.1,

const couchbase = require(‘couchbase’);

await couchbase.connect(‘couchbase://XXXXXXXXXXXXXXXXXXX’, {
 username: 'USERNAME',
 password: 'PASSWORD',
 kvTimeout: 3600000,
 kvDurableTimeout: 3600000,
 viewTimeout: 3600000,
 queryTimeout: 3600000,
 analyticsTimeout: 3600000,
 searchTimeout: 3600000,
 managementTimeout: 3600000
});
SpartanX1
  • 201
  • 2
  • 8