[{"id":"a6c77082.c53df","type":"ibmiot in","z":"af34d1a3.ca0d","authentication":"boundService","apiKey":"","inputType":"evt","deviceId":"","applicationId":"","deviceType":"+","eventType":"+","commandType":"","format":"json","name":"IBM IoT","service":"registered","allDevices":"","allApplications":"","allDeviceTypes":true,"allEvents":true,"allCommands":"","allFormats":"","qos":0,"x":123,"y":216,"wires":[["18db9503.a27adb"]]},{"id":"ffd2fbfc.2eade8","type":"cloudant out","z":"af34d1a3.ca0d","name":"","cloudant":"","database":"washing","service":"lorenz-cloudantNoSQLDB","payonly":true,"operation":"insert","x":630,"y":346,"wires":[]},{"id":"1aa4aa73.542ffe","type":"debug","z":"af34d1a3.ca0d","name":"","active":false,"console":"false","complete":"payload","x":716,"y":210.25,"wires":[]},{"id":"18db9503.a27adb","type":"function","z":"af34d1a3.ca0d","name":"flatten schema","func":"msg.payload = msg.payload.d;\nreturn msg;","outputs":1,"noerr":0,"x":328,"y":244.5,"wires":[["3174da79.d08a56"]]},{"id":"3174da79.d08a56","type":"function","z":"af34d1a3.ca0d","name":"limit to max 5000 entries","func":"var count = context.global.get('count') || 0;\ncount += 1;\ncontext.global.set('count',count);\nif (count < 5000) {\n return msg; \n}\n\n","outputs":1,"noerr":0,"x":282,"y":330,"wires":[["1aa4aa73.542ffe","ffd2fbfc.2eade8"]]}]