节点红色MongoDB限制需要一个整数
我正在尝试建立一个简单的物联网温度监测系统。节点红色似乎是一个很好的解决方案 我已经在ubuntu 16.04上安装了node red和mongodb。当我尝试将数据存储到mongodb中时,它会成功存储,但是,当我尝试从数据库中获取数据时,在调试选项卡上会出现以下错误:节点红色MongoDB限制需要一个整数,mongodb,node-red,Mongodb,Node Red,我正在尝试建立一个简单的物联网温度监测系统。节点红色似乎是一个很好的解决方案 我已经在ubuntu 16.04上安装了node red和mongodb。当我尝试将数据存储到mongodb中时,它会成功存储,但是,当我尝试从数据库中获取数据时,在调试选项卡上会出现以下错误:MongoError:limit需要一个整数 以下是我的节点: [{"id":"845a2d0f.f529f","type":"debug","z":"175fe64a.2e87ba","name":"","active":tr
MongoError:limit需要一个整数
以下是我的节点:
[{"id":"845a2d0f.f529f","type":"debug","z":"175fe64a.2e87ba","name":"","active":true,"console":"false","complete":"false","x":698,"y":118,"wires":[]},{"id":"37b967b4.5953a8","type":"http in","z":"175fe64a.2e87ba","name":"/iot request","url":"/iot","method":"get","swaggerDoc":"","x":229.9517059326172,"y":314.0511169433594,"wires":[["70d77b6c.c2f234"]]},{"id":"70d77b6c.c2f234","type":"mongodb in","z":"175fe64a.2e87ba","mongodb":"5b5bee5b.f2593","name":"retrieve hello","collection":"test","operation":"find","x":472.9545593261719,"y":356.5880432128906,"wires":[["3b3c5324.f2f78c"]]},{"id":"3b3c5324.f2f78c","type":"http response","z":"175fe64a.2e87ba","name":"show hello","x":760.960205078125,"y":311.91192626953125,"wires":[]},{"id":"ac92efad.22272","type":"mqtt in","z":"175fe64a.2e87ba","name":"get outtemp","topic":"/sensors/esp0/temp0","qos":"2","broker":"fd4c9ee3.0aa1a","x":193,"y":118,"wires":[["845a2d0f.f529f","63a9e917.39f568"]]},{"id":"63a9e917.39f568","type":"mongodb out","z":"175fe64a.2e87ba","mongodb":"5b5bee5b.f2593","name":"store temp","collection":"test","payonly":true,"upsert":false,"multi":false,"operation":"store","x":406,"y":219,"wires":[]},{"id":"5b5bee5b.f2593","type":"mongodb","z":"","hostname":"127.0.0.1","port":"27017","db":"testdb","name":""},{"id":"fd4c9ee3.0aa1a","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"200","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""}]
我是一个完全的乞丐,既有node red,也有mongodb,对mqtt有一些经验
我怎样才能解决这个问题呢?当Knollery给我指出正确的方向后,我发现 这就是我要做的: 在mongodb find block之前添加一个函数,并在此函数中输入: msg.limit=5
msg.skip=0
返回味精
我认为这个问题在最新版本的mongo node red node中得到了修复。与其在评论中试着调试它,你能在node红色邮件列表(nodered.org底部的链接)上发布吗@knollery谢谢你的提示,还有一个人在邮件列表上有同样的问题(在我的谷歌搜索中没有显示);问题解决你是救世主!