{"id":43453,"library":"node-red-contrib-mongodb3","title":"MongoDB 3 Node-RED Node","description":"A Node-RED node that provides an interface to MongoDB using the MongoDB 3.x native Node.js driver. Current stable version is 2.0.1, released in 2019. It supports CRUD operations, aggregation, and connection management via a URI string with optional authentication fields. Key differentiators: built specifically for Node-RED with a visual flow editor, supports parallelism limiting to avoid socket clogging, and allows direct access to db/collection objects. Based on the older node-red-contrib-mongodb2 but updated for driver 3.0. Low release cadence; not actively maintained.","status":"maintenance","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/ozomer/node-red-contrib-mongodb2","tags":["javascript","node-red","bluemix","mongodb"],"install":[{"cmd":"npm install node-red-contrib-mongodb3","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-contrib-mongodb3","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-contrib-mongodb3","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"MongoDB native driver v3.x is required for all database operations","package":"mongodb","optional":false},{"reason":"Required as the runtime environment; the node is a Node-RED plugin","package":"node-red","optional":false}],"imports":[{"note":"This is a Node-RED node, not a standard JS module. It's used within Node-RED flows, not imported in code.","symbol":"mongodb3 node","correct":"Install via Node-RED palette manager or npm: npm install node-red-contrib-mongodb3"}],"quickstart":{"code":"// No code import necessary. Install the node in Node-RED and use it in flows.\n// Example: drag a mongodb3 node, configure URI (e.g., mongodb://localhost:27017/mydb),\n// set operation to 'find', payload to {name: \"test\"}, and deploy.\n// Result: msg.payload contains the query result.","lang":"javascript","description":"Demonstrates how to use the node in Node-RED: install, configure connection URI, set operation and payload."},"warnings":[{"fix":"Update flows that rely on the exact property names in msg. Check docs for new response structure.","message":"Version 2.0 changes: driver response props are now (correctly) added to message","severity":"breaking","affected_versions":"2.0.0"},{"fix":"Use either the dedicated fields OR embed credentials in the URI, but not both.","message":"Do not enter credentials both in the URI and the Username & Password fields - this will create an invalid URI","severity":"gotcha","affected_versions":"*"},{"fix":"Wrap the array in another array: msg.payload = [[{_id: 1}, {_id: 2}]]","message":"Passing a single parameter that is an array (e.g., for insertMany) must be wrapped in an outer array: msg.payload = [[...]]","severity":"gotcha","affected_versions":"*"},{"fix":"Set parallelism-limit to a reasonable number (e.g., 5-10) to avoid performance issues.","message":"Parallelism limit controls concurrency; setting too high can clog sockets","severity":"gotcha","affected_versions":"*"},{"fix":"Avoid calling disconnect() or close() on db/collection obtained from this node; let the node manage the connection.","message":"Using db/collection operations directly can cause disconnections; do not disconnect the shared instance","severity":"gotcha","affected_versions":"*"},{"fix":"Upgrade to node-red-contrib-mongodb4 (if available) or use a different Node-RED MongoDB node that supports newer drivers.","message":"MongoDB 3.x driver is deprecated; consider migrating to mongodb 4.x or later","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.0.1':30 '2019':33 '3':2,21 '3.0':90 'access':73 'activ':95 'aggreg':38 'allow':71 'authent':48 'avoid':67 'base':77 'bluemix':101 'built':52 'cadenc':93 'clog':69 'connect':40 'contrib':84 'crud':36 'current':26 'db/collection':75 'differenti':51 'direct':72 'driver':25,89 'editor':62 'field':49 'flow':61 'interfac':15 'javascript':97 'key':50 'limit':65 'low':91 'maintain':96 'manag':41 'mongodb':1,17,20,102 'mongodb2':85 'nativ':23 'node':4,6,9,11,56,82,99 'node-r':3,8,55,98 'node-red-contrib-mongodb2':81 'node.js':24 'object':76 'older':80 'oper':37 'option':47 'parallel':64 'provid':13 'red':5,10,57,83,100 'releas':31,92 'socket':68 'specif':53 'stabl':27 'string':45 'support':35,63 'updat':87 'uri':44 'use':18 'version':28 'via':42 'visual':60 'x':22","created_at":"2026-06-05T16:59:52.487328+00:00","updated_at":"2026-06-05T16:59:52.487328+00:00","problems":[{"fix":"Start MongoDB service or check the URI configuration.","cause":"MongoDB server not running or wrong host/port.","error":"Error: connect ECONNREFUSED 127.0.0.1:27017"},{"fix":"Verify credentials and add authSource parameter to URI, e.g., mongodb://user:pass@host:port/db?authSource=admin","cause":"Incorrect username/password, or authSource not specified.","error":"MongoError: Authentication failed"},{"fix":"Set msg.payload = [[{ ... }]] instead of [{ ... }]","cause":"For operations expecting an array (e.g., insertMany), payload must be an array inside an array.","error":"TypeError: msg.payload is not iterable"},{"fix":"Ensure URI includes a database path (e.g., mongodb://localhost:27017/mydb) and the node is deployed.","cause":"Connection has not been established or the node is not configured with a valid database name in URI.","error":"TypeError: Cannot read property 'collection' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/ozomer/node-red-contrib-mongodb2#readme","github":"https://github.com/ozomer/node-red-contrib-mongodb2","docs":null,"changelog":null,"pypi":null,"npm":"node-red-contrib-mongodb3","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}