Description
Issue:
Received below error and node express app crashed.
Segmentation fault (core dumped)
While checking scope name getting above error.
let uri = `couchbase://${connConfig.endPoint}/${connConfig.bucket}${advConnString}` //console.log(uri) |
const cbCluster = await couchbase.connect(uri, |
{ username: connConfig.user, password: connConfig.password });
|
|
const cbBucket = await cbCluster.bucket(connConfig.bucket); |
const cbScopes = await cbBucket.collections().getAllScopes(); |
let outputMessage = "Scope Name not present !" |
|
for (let i = 0; i < cbScopes.length; i++) { |
if (connConfig.scopeName === cbScopes[i].name.trim()) { |
outputMessage = "Success"; |
break; |
}
|
}
|
|
console.log(outputMessage)
|
and while traversing collections also getting same error.
const tablesList = [] |
const couchbaseUri = `couchbase://${connConfig.endPoint}/${connConfig.bucket}${advConnString}` |
//console.log(couchbaseUri)
|
const cbCluster = await couchbase.connect(couchbaseUri, |
{ username: connConfig.user, password: connConfig.password });
|
|
const cbBucket = await cbCluster.bucket(connConfig.bucket); |
const cbScopes = await cbBucket.collections().getAllScopes(); |
|
for (let i = 0; i < cbScopes.length; i++) { |
if (connConfig.scopeName === cbScopes[i].name.trim()) { |
cbScopes[i].collections.forEach((table, idx) => {
|
let cbEntry = {}
|
cbEntry['collectionName'] = table.name; |
cbEntry['id'] = idx + 1; |
tablesList.push(cbEntry)
|
})
|
break; |
}
|
}
|
console.log(tablesList)
|