ozomer / node-red-contrib-mongodb2

MongoDB driver node for Node-RED
Apache License 2.0
15 stars 19 forks source link

fix db and collection operations and returning obj instead of array #44

Open 586837r opened 4 years ago

586837r commented 4 years ago

cloning the response breaks db and collection instances not sure if this is a good way to fix it but it works

586837r commented 4 years ago

fixes #37

jomel commented 4 years ago

I was looking into a fix too, and thought it would have been better to check whether 'response' is an array at that point, rather than hard-coding the methods... didn't have the time to do testing as I don't have a working nodered build right now.

Also, this will REQUIRE a docs entry & a full-version bump to 3.0 as this significantly changes behaviour and might break people's flows who have worked around the issue. (node-red won't automatically update a module acoss a major version, but will with a minor bump)