You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varobjTemplate={ip:['ip'],md5:['md5']}varfnCompareSchema=function(objMsg){vararrKeys=Object.keys(objMsg);for(vari=0;i<arrKeys.length;i++){if(typeofobjTemplate[arrKeys[i]]==='undefined'){//this is a new field, do something about it here}}};
Detect new data type values
varobjTemplate={ip:['ip'],md5:['md5']}vararrDataTypes=objDataTester.test(objMsg.ip);for(vari=0;i<arrDataTypes.length;i++){if(objTemplate.ip.indexOf(arrDataTypes[i])===-1){//this data type isn't in the templateconsole.log('new data type in msg',arrDataTypes[i]);}}
look for unique values
vararrKnownValues=['127.0.0.1','75.75.75.75','8.8.8.8'];if(arrKnownValues.indexOf(objMsg.ip)===-1){//this value is not in the known array of valuesconsole.log('new value:',objMsg.ip);}