Hi,
I am trying to upgarde my Node.js SDK version from 3.0.2 to 4.1.0 While executing N1Ql get an error service not avilable. My Express version is 4.18.1. Can someone help me? The code snippet is taking from SDK document itself.
var couchbase = require(‘couchbase’)
async function main() {
const clusterConnStr = ‘couchbases://cb..cloud.couchbase.com’
const username = ‘Administrator’
const password = ‘Password123!’
const bucketName = ‘travel-sample’
const cluster = await couchbase.connect(clusterConnStr, {
username: username,
password: password,
timeouts: {
kvTimeout: 10000, // milliseconds
},
})
const bucket = cluster.bucket(bucketName)
const defaultCollection = bucket.defaultCollection()
const collection = bucket.scope(‘tenant_agent_00’).collection(‘users’)
const queryResult = await cluster.query(‘SELECT name FROM airline
WHERE country=$1 LIMIT 10’, {
parameters: [‘United States’],
})
console.log(‘Query Results:’)
queryResult.rows.forEach((row) => {
console.log(row)
})
}
// Run the main function
main()
.catch((err) => {
console.log(‘ERR:’, err)
process.exit(1)
})
.then(process.exit)