DATABASE 5

node-red-node-ui-table 0.3.5

A Node-RED UI widget node which displays data as a table. 데이터를 테이블 리스트 형태로 보여줍니다. MongoDB에서 비콘정보를 읽어들여 Node-red에서 리스트 형태로 표시합니다. Function Node find.toArray msg.collection = 'CL_DEVICE_DATA_2'; msg.operation = 'find.toArray'; msg.payload = { }; // msg.payload = { "DE_MAC" : "AC:23:3F:50:1B:60", "GW_MAC" : "B8:27:EB:20:EA:17" }; return msg; Function node - return array 일정시간내 데이터를 json 형태로 변환하여 테이블..

DATABASE 2020.10.03

Pymongo rest.py & Studio 3T

Pymongo는 MongoDB 주변의 저수준 Python 래퍼이며 Pymongo로 작업하는 것은 MongoDB 쿼리를 직접 작성하는 것과 유사합니다. 1) Pymongo is a low-level Python wrapper around MongoDB, working with Pymongo is similar to writing the MongoDB query directly. 2) MongoEngine is an Object-Document Mapper, which uses a document schema that makes working with MongoDB clear and easier. ''' -------------- Raspberry Pi (bluetooth)-------------- ''' ..

DATABASE 2020.10.03

Node-RED on MongoDB

데이터 어레이 가져오기 마지막 데이터 10개 가져오기 var i; var a = []; for(i = 0; i < 10; i++) // msg.payload.length; i++) { a.push(msg.payload[msg.payload.length-1-i]); } var newMsg = { payload : a }; return newMsg; 20초 동안 받은 데이터 구하기 var today = new Date(Date.now() - 1000*20); var i; var a = []; for(i = 0; i < msg.payload.length; i++) { var d = new Date(msg.payload[i].GW_DT_UTC); if(today < d) { a.push(msg.payload[i..

DATABASE 2020.09.30