INNER CODE UNIT · JavaScript
getConnections
riclolsen/json-scada · src/OPC-UA-Server/index.js:1052
async function getConnections(connsCollection, configObj) {
let results = await connsCollection
.find({
protocolDriver: AppDefs.NAME,
protocolDriverInstanceNumber: configObj.Instance,
enabled: true,
})
.sort({ protocolConnectionNumber: 1 })
.toArray()
if (!results || !('length' in results) || results.length == 0) {
Log.log('Connection - No protocol connection found!')
process.exit(1)
}
return results
}
// test mongoDB connectivity