728x90
Node-RED
|
|
Mongodb config
속성 | mongodb2 server 정보 |
function 노드 수정 | Debug |
|
|
MongoDB 확인 | |
참조 |
|
MongoError: docs parameter must be an array of documents (mongodb3) |
https://discourse.nodered.org/t/mongoerror-docs-parameter-must-be-an-array-of-documents-mongodb3/18191 |
토양센서 리스트
토양센서 리스트 Node-RED
|
Node 내보내기
[{"id":"eca97310c7323217","type":"ui_table","z":"4037d292a5a4d2cb","group":"6c043ee02c40eb0a","name":"토양센서 리스트","order":14,"width":"9","height":9,"columns":[{"field":"device","title":"토양센서","width":"20%","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"temp","title":"온도","width":"20%","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"humi","title":"습도","width":"20%","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"date","title":"DATE","width":"40%","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}}],"outputs":0,"cts":false,"x":1280,"y":1280,"wires":[]},{"id":"bec649ac46ae5bae","type":"function","z":"4037d292a5a4d2cb","name":"get names as a list","func":"// Outputs separate messages !!\nvar newMsg = [];\nvar date = new Date();\n\nfor (var i = 0; i < msg.payload.length; i++) { \n newMsg.push(\n { \n device: msg.payload[i].device,\n temp: msg.payload[i].temp,\n humi: msg.payload[i].humi,\n date: (msg.payload[i].date == undefined) ? ' ' : new Date(msg.payload[i].date - (date.getTimezoneOffset() * 60000 )).toISOString()\n }\n ); \n};\n\nmsg.payload = newMsg;\n\nreturn msg;\n\n\n// for (var i = 0; i < msg.payload.length; i++) {\n// msg.payload.date = new Date(msg.payload.date - (date.getTimezoneOffset() * 60000 ))\n// .toISOString();\n// }\n \n// msg.payload.sort(function(a, b) {\n// return a.device - b.device;\n// });\n\n// return msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1030,"y":1240,"wires":[["eca97310c7323217","588ceca4a50187a2"]]},{"id":"588ceca4a50187a2","type":"debug","z":"4037d292a5a4d2cb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1270,"y":1220,"wires":[]},{"id":"2ed99169fdc8c34e","type":"inject","z":"4037d292a5a4d2cb","name":"4) Output once only as a list","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"30","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"str","x":440,"y":1140,"wires":[["63ab6cfbf18e2a79"]]},{"id":"63ab6cfbf18e2a79","type":"function","z":"4037d292a5a4d2cb","name":"find.toArray","func":"var newMsg = {};\nnewMsg.collection = 'us_apple_soil_list';\nnewMsg.operation = 'find.toArray';\n//newMsg.payload = { 'name' : 'Pete1' , 'names' : 'Pete2' };\n// newMsg.payload = { 'name' : 'Pete1' };\nnewMsg.projection = { 'device' : 1 , 'temp' : 1, 'humi' : 1, 'date' : 1, '_id' : 0 };\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":668,"y":1141,"wires":[["a24322578ab4b8b6"]]},{"id":"a24322578ab4b8b6","type":"mongodb2 in","z":"4037d292a5a4d2cb","service":"_ext_","configNode":"44fc0d6f.e1e8f4","name":"Mongo DB dynamic operation","collection":"","operation":"","x":910,"y":1140,"wires":[["bec649ac46ae5bae","588ceca4a50187a2"]]},{"id":"6c043ee02c40eb0a","type":"ui_group","name":"AWS","tab":"cdbff6416041a3fa","order":1,"disp":true,"width":"12","collapse":false,"className":""},{"id":"44fc0d6f.e1e8f4","type":"mongodb2","uri":"mongodb://127.0.0.1/mydb","name":"admin","options":"","parallelism":""},{"id":"cdbff6416041a3fa","type":"ui_tab","name":"의성 사과원","icon":"dashboard","order":6,"disabled":false,"hidden":true}]
'NODE-RED' 카테고리의 다른 글
Node-RED 에서 Esp32 커스텀 제작보드와 통신 (0) | 2024.11.09 |
---|---|
Node-RED 기존 데이터 삭제후 json 파일 업데이트 (0) | 2022.08.24 |
#1.4.3-3 mongoDB connect to Node-RED (0) | 2022.03.28 |
Node-RED 안드로이드 설치 (0) | 2022.03.07 |
Node-RED Background Image (0) | 2020.10.05 |