node-red-nodes
node-red-nodes copied to clipboard
Update 66-mongodb.js
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ x ] New feature (non-breaking change which adds functionality)
Proposed changes
Call done when the operation is complete
Checklist
- [ x ] I have read the contribution guidelines
- [ x ] For non-bugfix PRs, I have discussed this change on the forum/slack team.
- [ x ] I have run
gruntto verify the unit tests pass - [ ] I have added suitable unit tests to cover the new/changed functionality
Hi @dodois
Useful update but as the done capability was added later - you need to check if it exists before calling it in case someone is running a very old version that doesn't pass it it.
eg see - https://github.com/node-red/node-red-nodes/blob/master/storage/mysql/68-mysql.js#L110 and https://github.com/node-red/node-red-nodes/blob/master/storage/mysql/68-mysql.js#L110