Open duartegarin opened 5 years ago
I have the same problem with node-red-contrib-mongodb3 but using node-red-contrib-mongodb2 return an array.
node-red-contrib-mongodb3 return {0: object,1: object,2: object}
node-red-contrib-mongodb2 return [object, object, object]
Same pb. The problem was not present in 1.0.0 version. In addition, the count operation returns an empty object (no value)
I'm sorry but I don't have time to work on this. We are no longer using Node-RED in my company so I don't have motivation to make that effort :sweat_smile: If any of you wants to send a Pull-Request that fixes the issue and test it, I'll accept it blindly.
a workaround would be to add a function node after the mongodb node and convert the object to an array within nodered:
var obj = msg.payload
obj = Object.keys(obj).map((key) => obj[key]);
msg.payload = obj
return msg;
As the title says, find.toArray returning an object of objects instead of an array. Is this by design?