start.js
function(callback){
        if(source['brokerId']!='null'){
            db.db(dbName).collection(collectionName).find({brokerId:source['brokerId']}).toArray(function(err,result){
                mqttHost = result[0]['ipAddress'];
                mqttPort = result[0]['port'];
                console.log(result);
            });
        }else{
            mqttHost = mqttPort = null;
        }
    }
function(callback){
        if(source['brokerId']!='null'){
            db.db(dbName).collection(collectionName).find({brokerId:source['brokerId']}).toArray(function(err,result){
                mqttHost = result[0]['ipAddress'];
                mqttPort = result[0]['port'];
                console.log(result);
            });
        }else{
            mqttHost = mqttPort = null;
        }
    }
function ( callback ) { if ( source [ 'brokerId' ] != 'null' ) { db . db ( dbName ) . collection ( collectionName ) . find ( { brokerId : source [ 'brokerId' ] } ) . toArray ( function ( err , result ) { mqttHost = result [ 0 ] [ 'ipAddress' ] ; mqttPort = result [ 0 ] [ 'port' ] ; console . log ( result ) ; } ) ; } else { mqttHost = mqttPort = null ; } }
find broker for get mqtt url.
find broker for get mqtt url .