[{"data":1,"prerenderedAt":87},["ShallowReactive",2],{"integration-node-red-contrib-mongodb4\u002F":3},{"_id":4,"categories":5,"author":9,"description":11,"npmOwners":12,"npmScope":15,"name":4,"ffCertified":16,"downloads":17,"version":19,"updatedAt":20,"tier":21,"maintainers":22,"homepage":27,"bugs":28,"repository":30,"time":33,"lastUpdated":20,"created":34,"license":78,"githubOwner":13,"githubRepo":4,"examples":79,"readme":86},"node-red-contrib-mongodb4",[6,7,8],"catalogue_database","catalogue_storage","catalogue",{"name":10},"Christopher Steinbach","A MongoDB node for Node-Red without limitations.",[13,14],"steineey","csteinba",null,true,{"week":18},614,"3.4.0","2025-12-29T21:48:44.411Z","recommended",[23,25],{"name":13,"email":24},"christopher.steinbach@gmx.de",{"name":14,"email":26},"steinbach-anna@gmx.net","https:\u002F\u002Fgithub.com\u002Fsteineey\u002Fnode-red-contrib-mongodb4#readme",{"url":29},"https:\u002F\u002Fgithub.com\u002Fsteineey\u002Fnode-red-contrib-mongodb4\u002Fissues",{"type":31,"url":32},"git","git+https:\u002F\u002Fgithub.com\u002Fsteineey\u002Fnode-red-contrib-mongodb4.git",{"created":34,"modified":20,"1.0.0":35,"1.1.0":36,"1.1.1":37,"1.1.2":38,"1.1.3":39,"1.1.4":40,"1.1.5":41,"1.1.6":42,"1.1.7":43,"1.1.8":44,"1.1.9":45,"1.2.0":46,"1.2.1":47,"1.2.2":48,"1.2.3":49,"1.3.0":50,"1.3.1":51,"1.4.0":52,"1.5.0":53,"1.6.0":54,"1.7.0":55,"1.8.0":56,"1.8.1":57,"1.9.0":58,"1.9.1":59,"1.10.0":60,"2.0.0":61,"2.1.0-dev":62,"2.1.0":63,"2.2.0":64,"2.2.1":65,"2.2.2-dev":66,"2.2.2":67,"2.3.0":68,"2.4.0":69,"2.5.0":70,"2.5.1":71,"2.5.2":72,"3.0.0":73,"3.1.0":74,"3.1.1":75,"3.3.0":76,"3.4.0":77},"2021-12-08T21:16:40.060Z","2021-12-08T21:16:40.177Z","2021-12-10T22:05:17.291Z","2021-12-10T22:11:48.468Z","2021-12-12T15:14:16.126Z","2021-12-13T19:07:33.093Z","2021-12-13T19:08:39.371Z","2021-12-13T19:14:13.359Z","2021-12-15T12:38:55.767Z","2021-12-17T13:46:38.568Z","2021-12-17T14:17:23.977Z","2021-12-18T20:41:37.701Z","2021-12-30T14:46:22.507Z","2022-01-03T20:13:54.563Z","2022-01-11T19:59:16.849Z","2022-01-21T08:52:13.639Z","2022-04-04T20:37:53.630Z","2022-04-08T21:01:35.764Z","2022-04-27T11:23:08.212Z","2022-07-29T01:08:44.621Z","2022-08-28T09:43:57.458Z","2022-09-27T18:34:39.977Z","2022-10-26T19:55:42.650Z","2022-11-02T22:17:18.387Z","2022-12-03T18:47:23.403Z","2022-12-03T19:27:28.442Z","2023-02-02T21:04:56.624Z","2023-04-10T14:32:17.774Z","2023-05-28T18:27:45.617Z","2023-06-01T19:40:03.898Z","2023-07-02T19:59:23.072Z","2023-07-02T20:23:27.263Z","2023-07-08T08:20:41.361Z","2023-07-12T20:56:21.632Z","2023-08-27T12:09:16.657Z","2023-10-15T13:06:46.910Z","2023-11-02T17:49:26.446Z","2023-11-19T21:46:30.798Z","2024-01-18T20:31:47.575Z","2025-01-05T14:08:57.076Z","2025-02-23T08:41:53.604Z","2025-02-23T08:49:53.012Z","2025-12-02T22:20:50.510Z","2025-12-29T21:48:44.215Z","MIT",[80],{"name":81,"path":82,"url":83,"downloadUrl":84,"flow":85},"example-1","examples\u002Fexample-1.json","https:\u002F\u002Fgithub.com\u002Fcsteinba\u002Fnode-red-contrib-mongodb4\u002Fblob\u002Fmaster\u002Fexamples\u002Fexample-1.json","https:\u002F\u002Fraw.githubusercontent.com\u002Fcsteinba\u002Fnode-red-contrib-mongodb4\u002Fmaster\u002Fexamples\u002Fexample-1.json","[{\"id\":\"6b7a48cdf37ecce9\",\"type\":\"tab\",\"label\":\"Example mongodb4\",\"disabled\":false,\"info\":\"\",\"env\":[]},{\"id\":\"fe36b4aab8e4b51e\",\"type\":\"inject\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":\"0\",\"topic\":\"\",\"payloadType\":\"date\",\"x\":140,\"y\":80,\"wires\":[[\"02df4cd3db727bea\"]]},{\"id\":\"02df4cd3db727bea\",\"type\":\"function\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"set payload\",\"func\":\"msg.payload = [{name: 'marina', age: 22}];\\nreturn msg;\",\"outputs\":1,\"timeout\":\"\",\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":310,\"y\":80,\"wires\":[[\"fbdbc88728b6bb53\"]]},{\"id\":\"fbdbc88728b6bb53\",\"type\":\"mongodb4\",\"z\":\"6b7a48cdf37ecce9\",\"clientNode\":\"e2bc7ac9aa77279e\",\"mode\":\"collection\",\"collection\":\"persons\",\"operation\":\"insertOne\",\"output\":\"toArray\",\"maxTimeMS\":\"\",\"handleDocId\":false,\"name\":\"\",\"x\":480,\"y\":80,\"wires\":[[\"ad6bea22c0e0b689\"]]},{\"id\":\"ad6bea22c0e0b689\",\"type\":\"debug\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"false\",\"statusVal\":\"\",\"statusType\":\"auto\",\"x\":710,\"y\":80,\"wires\":[]},{\"id\":\"8ee269b8753b02a1\",\"type\":\"inject\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"topic\":\"\",\"payloadType\":\"date\",\"x\":140,\"y\":140,\"wires\":[[\"b3879290c479d05d\"]]},{\"id\":\"b3879290c479d05d\",\"type\":\"function\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"set payload\",\"func\":\"msg.payload = [[\\n    {name: 'chris', age: 22},\\n    {name: 'markus', age: 22}\\n]];\\nreturn msg;\",\"outputs\":1,\"timeout\":\"\",\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":310,\"y\":140,\"wires\":[[\"f5c11e1900707b1c\"]]},{\"id\":\"f5c11e1900707b1c\",\"type\":\"mongodb4\",\"z\":\"6b7a48cdf37ecce9\",\"clientNode\":\"e2bc7ac9aa77279e\",\"mode\":\"collection\",\"collection\":\"persons\",\"operation\":\"insertMany\",\"output\":\"toArray\",\"handleDocId\":false,\"name\":\"\",\"x\":490,\"y\":140,\"wires\":[[\"7a265f43dea48889\"]]},{\"id\":\"7a265f43dea48889\",\"type\":\"debug\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"false\",\"statusVal\":\"\",\"statusType\":\"auto\",\"x\":710,\"y\":140,\"wires\":[]},{\"id\":\"5c8f4bef1a115679\",\"type\":\"inject\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"topic\":\"\",\"payloadType\":\"date\",\"x\":140,\"y\":260,\"wires\":[[\"df0db7fed54ff2ef\"]]},{\"id\":\"df0db7fed54ff2ef\",\"type\":\"function\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"set payload\",\"func\":\"msg.payload = [{name: 'marina'}, {fields: {name: 1, age: 1}}];\\nreturn msg;\",\"outputs\":1,\"timeout\":\"\",\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":310,\"y\":260,\"wires\":[[\"fb9612f0dabb7e67\"]]},{\"id\":\"fb9612f0dabb7e67\",\"type\":\"mongodb4\",\"z\":\"6b7a48cdf37ecce9\",\"clientNode\":\"e2bc7ac9aa77279e\",\"mode\":\"collection\",\"collection\":\"persons\",\"operation\":\"findOne\",\"output\":\"toArray\",\"handleDocId\":false,\"name\":\"\",\"x\":480,\"y\":260,\"wires\":[[\"fc1f0dfb426c9034\"]]},{\"id\":\"fc1f0dfb426c9034\",\"type\":\"debug\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"false\",\"statusVal\":\"\",\"statusType\":\"auto\",\"x\":710,\"y\":260,\"wires\":[]},{\"id\":\"5b61665e0f5cc0c5\",\"type\":\"inject\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"topic\":\"\",\"payloadType\":\"date\",\"x\":140,\"y\":320,\"wires\":[[\"91c84ba4d12fb033\"]]},{\"id\":\"91c84ba4d12fb033\",\"type\":\"function\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"set payload\",\"func\":\"msg.payload = [{name: \\\"marina\\\"}];\\nreturn msg;\",\"outputs\":1,\"timeout\":\"\",\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":310,\"y\":320,\"wires\":[[\"daa4aeeeb29120ca\"]]},{\"id\":\"daa4aeeeb29120ca\",\"type\":\"mongodb4\",\"z\":\"6b7a48cdf37ecce9\",\"clientNode\":\"e2bc7ac9aa77279e\",\"mode\":\"collection\",\"collection\":\"persons\",\"operation\":\"find\",\"output\":\"toArray\",\"maxTimeMS\":\"\",\"handleDocId\":false,\"name\":\"find.toArray\",\"x\":490,\"y\":320,\"wires\":[[\"39ce7da42ba01b32\"]]},{\"id\":\"39ce7da42ba01b32\",\"type\":\"debug\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"false\",\"statusVal\":\"\",\"statusType\":\"auto\",\"x\":710,\"y\":320,\"wires\":[]},{\"id\":\"1075d26bfd292f92\",\"type\":\"inject\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"topic\":\"\",\"payloadType\":\"date\",\"x\":140,\"y\":380,\"wires\":[[\"f83a21e14acc6837\"]]},{\"id\":\"f83a21e14acc6837\",\"type\":\"function\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"set payload\",\"func\":\"msg.payload = [{name: \\\"marina\\\"}];\\nreturn msg;\",\"outputs\":1,\"timeout\":\"\",\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":310,\"y\":380,\"wires\":[[\"0d76106c415ab9bc\"]]},{\"id\":\"0d76106c415ab9bc\",\"type\":\"mongodb4\",\"z\":\"6b7a48cdf37ecce9\",\"clientNode\":\"e2bc7ac9aa77279e\",\"mode\":\"collection\",\"collection\":\"persons\",\"operation\":\"find\",\"output\":\"forEach\",\"handleDocId\":false,\"name\":\"find.forEach\",\"x\":490,\"y\":380,\"wires\":[[\"6c446d0d50cd33eb\"]]},{\"id\":\"6c446d0d50cd33eb\",\"type\":\"debug\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"false\",\"statusVal\":\"\",\"statusType\":\"auto\",\"x\":710,\"y\":380,\"wires\":[]},{\"id\":\"e00d5ecdcb458feb\",\"type\":\"inject\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"topic\":\"\",\"payloadType\":\"date\",\"x\":140,\"y\":440,\"wires\":[[\"5a7163e6a172dec5\"]]},{\"id\":\"5a7163e6a172dec5\",\"type\":\"function\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"set payload\",\"func\":\"msg.payload = [{name: \\\"marina\\\"}];\\nreturn msg;\",\"outputs\":1,\"timeout\":\"\",\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":310,\"y\":440,\"wires\":[[\"eeb034c85f0a357e\"]]},{\"id\":\"eeb034c85f0a357e\",\"type\":\"mongodb4\",\"z\":\"6b7a48cdf37ecce9\",\"clientNode\":\"e2bc7ac9aa77279e\",\"mode\":\"collection\",\"collection\":\"persons\",\"operation\":\"countDocuments\",\"output\":\"toArray\",\"maxTimeMS\":\"\",\"handleDocId\":false,\"name\":\"countDocuments\",\"x\":510,\"y\":440,\"wires\":[[\"2f288690a68278bd\"]]},{\"id\":\"2f288690a68278bd\",\"type\":\"debug\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"false\",\"statusVal\":\"\",\"statusType\":\"auto\",\"x\":710,\"y\":440,\"wires\":[]},{\"id\":\"d5700bd465e13fa5\",\"type\":\"inject\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"topic\":\"\",\"payloadType\":\"date\",\"x\":140,\"y\":200,\"wires\":[[\"2581ad0e69bb4b74\"]]},{\"id\":\"2581ad0e69bb4b74\",\"type\":\"function\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"set payload\",\"func\":\"msg.payload = [{}, {$inc: {age: 1}, $set: {aged: true}}];\\nreturn msg;\",\"outputs\":1,\"timeout\":\"\",\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":310,\"y\":200,\"wires\":[[\"ec5005a3a476c75b\"]]},{\"id\":\"ec5005a3a476c75b\",\"type\":\"mongodb4\",\"z\":\"6b7a48cdf37ecce9\",\"clientNode\":\"e2bc7ac9aa77279e\",\"mode\":\"collection\",\"collection\":\"persons\",\"operation\":\"updateMany\",\"output\":\"toArray\",\"handleDocId\":false,\"name\":\"\",\"x\":490,\"y\":200,\"wires\":[[\"513e182443df307e\"]]},{\"id\":\"513e182443df307e\",\"type\":\"debug\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"false\",\"statusVal\":\"\",\"statusType\":\"auto\",\"x\":710,\"y\":200,\"wires\":[]},{\"id\":\"0f1419fe40a054a4\",\"type\":\"inject\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"x\":140,\"y\":500,\"wires\":[[\"103caed91230c198\"]]},{\"id\":\"103caed91230c198\",\"type\":\"function\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"set payload\",\"func\":\"msg.payload = [{age: {$gt: 25}}];\\nreturn msg;\",\"outputs\":1,\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":310,\"y\":500,\"wires\":[[\"3b5f6cbbc8585516\"]]},{\"id\":\"3b5f6cbbc8585516\",\"type\":\"mongodb4\",\"z\":\"6b7a48cdf37ecce9\",\"clientNode\":\"e2bc7ac9aa77279e\",\"mode\":\"collection\",\"collection\":\"persons\",\"operation\":\"deleteMany\",\"output\":\"toArray\",\"handleDocId\":false,\"name\":\"\",\"x\":490,\"y\":500,\"wires\":[[\"d69cf47b58e754d7\"]]},{\"id\":\"d69cf47b58e754d7\",\"type\":\"debug\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"false\",\"statusVal\":\"\",\"statusType\":\"auto\",\"x\":710,\"y\":500,\"wires\":[]},{\"id\":\"d72c3423667d2fe7\",\"type\":\"inject\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"x\":140,\"y\":620,\"wires\":[[\"4fbc5c911d465894\"]]},{\"id\":\"4fbc5c911d465894\",\"type\":\"mongodb4\",\"z\":\"6b7a48cdf37ecce9\",\"clientNode\":\"e2bc7ac9aa77279e\",\"mode\":\"db\",\"collection\":\"\",\"operation\":\"stats\",\"output\":\"toArray\",\"handleDocId\":false,\"name\":\"db stats\",\"x\":480,\"y\":620,\"wires\":[[\"53eb06efe65bcfc4\"]]},{\"id\":\"53eb06efe65bcfc4\",\"type\":\"debug\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"payload\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"payload\",\"targetType\":\"msg\",\"statusVal\":\"\",\"statusType\":\"auto\",\"x\":700,\"y\":620,\"wires\":[]},{\"id\":\"4efb71ded2d8a294\",\"type\":\"inject\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"x\":140,\"y\":560,\"wires\":[[\"f345242e576f8361\"]]},{\"id\":\"f345242e576f8361\",\"type\":\"function\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"distinct name\",\"func\":\"msg.payload = [\\\"name\\\"];\\nreturn msg;\",\"outputs\":1,\"timeout\":\"\",\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":320,\"y\":560,\"wires\":[[\"9960080cec50e212\"]]},{\"id\":\"9960080cec50e212\",\"type\":\"mongodb4\",\"z\":\"6b7a48cdf37ecce9\",\"clientNode\":\"e2bc7ac9aa77279e\",\"mode\":\"collection\",\"collection\":\"persons\",\"operation\":\"distinct\",\"output\":\"toArray\",\"handleDocId\":false,\"name\":\"\",\"x\":480,\"y\":560,\"wires\":[[\"df8bfd9233fa703a\"]]},{\"id\":\"df8bfd9233fa703a\",\"type\":\"debug\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"false\",\"statusVal\":\"\",\"statusType\":\"auto\",\"x\":710,\"y\":560,\"wires\":[]},{\"id\":\"dbc02d8d149860a4\",\"type\":\"inject\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"props\":[{\"p\":\"payload\"},{\"p\":\"topic\",\"vt\":\"str\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":\"0\",\"topic\":\"\",\"payloadType\":\"date\",\"x\":140,\"y\":680,\"wires\":[[\"cc427c20716a7e39\"]]},{\"id\":\"cc427c20716a7e39\",\"type\":\"function\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"set payload\",\"func\":\"msg.mode = \\\"collection\\\";\\nmsg.collection = \\\"persons\\\";\\nmsg.operation = \\\"insertOne\\\";\\nmsg.payload = [{name: 'marina', age: 22}];\\nreturn msg;\",\"outputs\":1,\"timeout\":\"\",\"noerr\":0,\"initialize\":\"\",\"finalize\":\"\",\"libs\":[],\"x\":310,\"y\":680,\"wires\":[[\"d2da5a768c22c7a1\"]]},{\"id\":\"d2da5a768c22c7a1\",\"type\":\"mongodb4\",\"z\":\"6b7a48cdf37ecce9\",\"clientNode\":\"e2bc7ac9aa77279e\",\"mode\":\"dynamic\",\"collection\":\"\",\"operation\":\"\",\"output\":\"toArray\",\"maxTimeMS\":\"\",\"handleDocId\":false,\"name\":\"dynamic\",\"x\":480,\"y\":680,\"wires\":[[\"5bf88273e768aa08\"]]},{\"id\":\"5bf88273e768aa08\",\"type\":\"debug\",\"z\":\"6b7a48cdf37ecce9\",\"name\":\"\",\"active\":true,\"tosidebar\":true,\"console\":false,\"tostatus\":false,\"complete\":\"false\",\"statusVal\":\"\",\"statusType\":\"auto\",\"x\":690,\"y\":680,\"wires\":[]},{\"id\":\"e2bc7ac9aa77279e\",\"type\":\"mongodb4-client\",\"name\":\"simple connection\",\"protocol\":\"mongodb\",\"hostname\":\"mongodb\",\"port\":\"27017\",\"dbName\":\"nodered\",\"appName\":\"nodered\",\"authSource\":\"admin\",\"authMechanism\":\"SCRAM-SHA-256\",\"tls\":false,\"tlsCAFile\":\"\",\"tlsCertificateKeyFile\":\"\",\"tlsInsecure\":false,\"connectTimeoutMS\":\"\",\"socketTimeoutMS\":\"\",\"minPoolSize\":\"\",\"maxPoolSize\":\"\",\"maxIdleTimeMS\":\"\",\"uri\":\"\",\"advanced\":\"{\\\"connectTimeoutMS\\\": 30000}\",\"uriTabActive\":\"tab-uri-simple\"},{\"id\":\"cb6ee58e56f0578d\",\"type\":\"global-config\",\"env\":[],\"modules\":{\"node-red-contrib-mongodb4\":\"3.4.0\"}}]","\u003Ch1 id=\"node-red-contrib-mongodb4\">\u003Ca class=\"header-anchor\" href=\"#node-red-contrib-mongodb4\">node-red-contrib-mongodb4\u003C\u002Fa>\u003C\u002Fh1>\n\u003Cp>A MongoDB driver node for Node-RED that exposes the native MongoDB Node.js driver features without limitations.\u003C\u002Fp>\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fwww.npmjs.org\u002Fpackage\u002Fnode-red-contrib-mongodb4\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fnode-red-contrib-mongodb4.svg?style=flat-square\" alt=\"npm version\" \u002F>\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Fpackagephobia.now.sh\u002Fresult?p=node-red-contrib-mongodb4\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdynamic\u002Fjson?url=https:\u002F\u002Fpackagephobia.com\u002Fv2\u002Fapi.json?p=node-red-contrib-mongodb4&amp;query=$.install.pretty&amp;label=install%20size&amp;style=flat-square\" alt=\"install size\" \u002F>\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Fnpm-stat.com\u002Fcharts.html?package=node-red-contrib-mongodb4\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdm\u002Fnode-red-contrib-mongodb4.svg?style=flat-square\" alt=\"npm downloads\" \u002F>\u003C\u002Fa>\u003C\u002Fp>\n\u003Cp>This package provides two Node-RED nodes:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Config Node\u003C\u002Fstrong> — manage MongoDB connections and connection pools.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Flow Node\u003C\u002Fstrong> — perform database and collection operations using the native MongoDB driver API.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Table of Contents\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Installation\u003C\u002Fli>\n\u003Cli>Quick Start\u003C\u002Fli>\n\u003Cli>Compatibility\u003C\u002Fli>\n\u003Cli>Configuration Node\u003C\u002Fli>\n\u003Cli>Flow Node\u003C\u002Fli>\n\u003Cli>BSON Types\u003C\u002Fli>\n\u003Cli>Development\u003C\u002Fli>\n\u003Cli>Links\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"installation\">\u003Ca class=\"header-anchor\" href=\"#installation\">Installation\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>From your \u003Ccode>~\u002F.node-red\u003C\u002Fcode> directory run:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">npm install --save --omit=dev node-red-contrib-mongodb4\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2 id=\"quick-start\">\u003Ca class=\"header-anchor\" href=\"#quick-start\">Quick Start\u003C\u002Fa>\u003C\u002Fh2>\n\u003Col>\n\u003Cli>Add a \u003Cstrong>MongoDB Config Node\u003C\u002Fstrong> and configure the connection (URI or host\u002Fport, database, auth).\u003C\u002Fli>\n\u003Cli>Add a \u003Cstrong>MongoDB Flow Node\u003C\u002Fstrong> and select the config node, operation and collection.\u003C\u002Fli>\n\u003Cli>Pass operation arguments into \u003Ccode>msg.payload\u003C\u002Fcode> as an array — the array items are passed as function arguments to the driver.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>Examples\u003C\u002Fp>\n\u003Cp>Insert one document:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-js\">msg.payload = [{ name: 'Anna', age: 1 }];\nreturn msg;\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Find with query and options:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-js\">const query = { age: 22 };\nconst options = { sort: { name: 1 }, projection: { name: 1 }, limit: 10, skip: 2 };\nmsg.payload = [query, options];\nreturn msg;\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Aggregate (pipeline + options):\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-js\">const pipeline = [ { $sort: { age: 1 } }, { $project: { name: 1 } }, { $limit: 10 } ];\nconst options = { allowDiskUse: true };\nmsg.payload = [pipeline, options];\nreturn msg;\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cblockquote>\n\u003Cp>Note: for aggregation you often end up with an array inside the payload array: \u003Ccode>msg.payload = [pipeline]\u003C\u002Fcode>.\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Ch2 id=\"compatibility\">\u003Ca class=\"header-anchor\" href=\"#compatibility\">Compatibility\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>Node-RED &gt;= v3.0.0\u003C\u002Fli>\n\u003Cli>Node.js &gt;= v16.20.1\u003C\u002Fli>\n\u003Cli>Compatible with MongoDB server versions: 4.0, 4.2, 4.4, 5.0, 6.0, 7.0, 8.0 (depending on driver)\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Version 3.x of this package uses the MongoDB driver v6.12 and contains breaking changes from earlier driver major versions — see the official MongoDB driver upgrade notes: https:\u002F\u002Fwww.mongodb.com\u002Fdocs\u002Fdrivers\u002Fnode\u002Fcurrent\u002Fupgrade\u002F#version-6.0-breaking-changes\u003C\u002Fp>\n\u003Ch2 id=\"configuration-node\">\u003Ca class=\"header-anchor\" href=\"#configuration-node\">Configuration Node\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>The config node creates a \u003Ccode>MongoClient\u003C\u002Fcode> and manages a connection pool. You can configure connection details in two ways:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Simple fields: protocol (\u003Ccode>mongodb\u003C\u002Fcode> \u002F \u003Ccode>mongodb+srv\u003C\u002Fcode>), hostname, port, database, username\u002Fpassword, auth source\u002Fmechanism.\u003C\u002Fli>\n\u003Cli>Full URI: provide a complete connection string.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Connection-related options available in the node include \u003Ccode>connectTimeoutMS\u003C\u002Fcode>, \u003Ccode>socketTimeoutMS\u003C\u002Fcode>, \u003Ccode>minPoolSize\u003C\u002Fcode>, \u003Ccode>maxPoolSize\u003C\u002Fcode>, \u003Ccode>maxIdleTimeMS\u003C\u002Fcode> and other \u003Ccode>MongoClientOptions\u003C\u002Fcode> (JSON).\u003C\u002Fp>\n\u003Cp>TLS options are supported: CA file, client certificate\u002Fkey file, and an option to disable certificate verification (not recommended).\u003C\u002Fp>\n\u003Cp>The config node will automatically generate an application name if you don't provide one (e.g. \u003Ccode>nodered-xxxxx\u003C\u002Fcode>). The application name is logged and can be used to inspect connections on the server.\u003C\u002Fp>\n\u003Cp>Example server-side check:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-js\">db.currentOp(true).inprog.reduce((acc, conn) =&gt; {\n    const appName = conn.appName || 'unknown';\n    acc[appName] = (acc[appName] || 0) + 1;\n    acc.totalCount = (acc.totalCount || 0) + 1;\n    return acc;\n}, { totalCount: 0 });\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2 id=\"flow-node\">\u003Ca class=\"header-anchor\" href=\"#flow-node\">Flow Node\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Use the flow node to execute collection or database operations.\u003C\u002Fp>\n\u003Cp>Key options\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Mode \u002F msg.mode\u003C\u002Fstrong>: \u003Ccode>collection\u003C\u002Fcode> or \u003Ccode>db\u003C\u002Fcode> (selects whether you call collection APIs or database APIs)\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Collection \u002F msg.collection\u003C\u002Fstrong>: target collection name\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Operation \u002F msg.operation\u003C\u002Fstrong>: driver operation name (e.g. \u003Ccode>find\u003C\u002Fcode>, \u003Ccode>findOne\u003C\u002Fcode>, \u003Ccode>insertOne\u003C\u002Fcode>, \u003Ccode>updateMany\u003C\u002Fcode>, \u003Ccode>aggregate\u003C\u002Fcode>, \u003Ccode>command\u003C\u002Fcode>, \u003Ccode>stats\u003C\u002Fcode>)\u003C\u002Fli>\n\u003Cli>\u003Cstrong>msg.payload\u003C\u002Fstrong>: an array of arguments passed to the driver method\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Output\u003C\u002Fstrong>: for \u003Ccode>find\u003C\u002Fcode> and \u003Ccode>aggregate\u003C\u002Fcode>, choose \u003Ccode>toArray\u003C\u002Fcode> or \u003Ccode>forEach\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>\u003Cstrong>maxTimeMS\u003C\u002Fstrong>: server-side operation timeout\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Common collection operations: \u003Ccode>find\u003C\u002Fcode>, \u003Ccode>findOne\u003C\u002Fcode>, \u003Ccode>insertOne\u003C\u002Fcode>, \u003Ccode>insertMany\u003C\u002Fcode>, \u003Ccode>updateOne\u003C\u002Fcode>, \u003Ccode>updateMany\u003C\u002Fcode>, \u003Ccode>deleteOne\u003C\u002Fcode>, \u003Ccode>deleteMany\u003C\u002Fcode>, \u003Ccode>aggregate\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>Deprecated: the legacy \u003Ccode>insert\u003C\u002Fcode>, \u003Ccode>update\u003C\u002Fcode>, \u003Ccode>delete\u003C\u002Fcode> helper methods are not supported by modern drivers — use the newer specific methods instead.\u003C\u002Fp>\n\u003Cp>The node returns the driver's response in \u003Ccode>msg.payload\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch2 id=\"bson-types\">\u003Ca class=\"header-anchor\" href=\"#bson-types\">BSON Types\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>If you need BSON types (e.g. \u003Ccode>ObjectId\u003C\u002Fcode>, \u003Ccode>Double\u003C\u002Fcode>, \u003Ccode>Timestamp\u003C\u002Fcode>) from the driver inside function nodes, add the driver to \u003Ccode>functionGlobalContext\u003C\u002Fcode> in your Node-RED \u003Ccode>settings.js\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-js\">functionGlobalContext: {\n    mongodb: require('node-red-contrib-mongodb4\u002Fnode_modules\u002Fmongodb')\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Then in a function node:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-js\">const { ObjectId } = global.get('mongodb');\nmsg.payload = [{ _id: new ObjectId('624b527d08e23628e99eb963') }];\nreturn msg;\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>The flow node can optionally convert string \u003Ccode>_id\u003C\u002Fcode> fields that look like valid \u003Ccode>ObjectId\u003C\u002Fcode>s to real \u003Ccode>ObjectId\u003C\u002Fcode> instances (deprecated feature — prefer explicit BSON types).\u003C\u002Fp>\n\u003Ch2 id=\"development\">\u003Ca class=\"header-anchor\" href=\"#development\">Development\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Start a local development environment (Node-RED + MongoDB) using the included \u003Ccode>docker-compose.yml\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">docker compose up -d\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Stop and remove containers:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">docker compose down\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Node-RED will be available at \u003Ccode>http:\u002F\u002Flocalhost:1880\u003C\u002Fcode> by default. Replace environment variables in \u003Ccode>docker-compose.yml\u003C\u002Fcode> with secure values for CI or production.\u003C\u002Fp>\n\u003Ch2 id=\"links\">\u003Ca class=\"header-anchor\" href=\"#links\">Links\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>Example flow: https:\u002F\u002Fraw.githubusercontent.com\u002Fcsteinba\u002Fnode-red-contrib-mongodb4\u002Fmaster\u002Fexamples\u002Fexample-1.json\u003C\u002Fli>\n\u003Cli>Collection API docs (driver): https:\u002F\u002Fmongodb.github.io\u002Fnode-mongodb-native\u002F6.21\u002Fclasses\u002FCollection.html\u003C\u002Fli>\n\u003Cli>MongoDB Node.js driver docs: https:\u002F\u002Fwww.mongodb.com\u002Fdocs\u002Fdrivers\u002Fnode\u002Fcurrent\u002F\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fmongodb.github.io\u002Fnode-mongodb-native\u002F6.21\u002Fclasses\u002FCollection.html\">Collection-API v6.21\u003C\u002Fa>\u003C\u002Fp>\n\u003Ch3 id=\"payload-output\">\u003Ca class=\"header-anchor\" href=\"#payload-output\">Payload Output\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>The node will output the database driver response as message payload.\nThe operations \u003Ccode>aggregate\u003C\u002Fcode> and \u003Ccode>find\u003C\u002Fcode> can output with \u003Ccode>toArray\u003C\u002Fcode> or \u003Ccode>forEach\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch3 id=\"how-to-use-bson-data-types-with-this-node\">\u003Ca class=\"header-anchor\" href=\"#how-to-use-bson-data-types-with-this-node\">How to use BSON data types with this Node\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>You can use BSON types with this node.\u003C\u002Fp>\n\u003Cp>First enable \"mongodb\" in your function global context. Add this to your \u003Ccode>settings.js\u003C\u002Fcode> file - typically this file located in \u003Ccode>~\u002F.node-red\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-js\">functionGlobalContext: {\n    mongodb: require(\"node-red-contrib-mongodb4\u002Fnode_modules\u002Fmongodb\")\n},\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>This kind of require statement ensures that we use the BSON types from the mongodb driver used in this node. Otherwise we could run into compatibilty issues.\u003C\u002Fp>\n\u003Cp>You can now use BSON types in your function node like so:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-js\">\u002F\u002F get BSON types\nconst {ObjectId, Double, Timestamp} = global.get(\"mongodb\");\n\u002F\u002F write your query\nmsg.payload = [{\n    _id: new ObjectId() , \n    value: new Double(1.4), \n    ts: new Timestamp()\n}];\n\u002F\u002F send them to the mongodb node\nreturn msg;\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3 id=\"node-status\">\u003Ca class=\"header-anchor\" href=\"#node-status\">Node Status\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Node status information is displayed below the node:\u003C\u002Fp>\n\u003Ch4 id=\"tags\">\u003Ca class=\"header-anchor\" href=\"#tags\">Tags\u003C\u002Fa>\u003C\u002Fh4>\n\u003Cul>\n\u003Cli>\u003Cstrong>s\u003C\u002Fstrong> : Number of successful executions\u003C\u002Fli>\n\u003Cli>\u003Cstrong>err\u003C\u002Fstrong> : Number of failed executions\u003C\u002Fli>\n\u003Cli>\u003Cstrong>rt\u003C\u002Fstrong> : Last execution runtime in ms\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch4 id=\"colors\">\u003Ca class=\"header-anchor\" href=\"#colors\">Colors\u003C\u002Fa>\u003C\u002Fh4>\n\u003Cul>\n\u003Cli>\u003Cstrong>green\u003C\u002Fstrong> : Last execution was successful\u003C\u002Fli>\n\u003Cli>\u003Cstrong>blue\u003C\u002Fstrong> : Node execution in progress\u003C\u002Fli>\n\u003Cli>\u003Cstrong>red\u003C\u002Fstrong> : Last execution failed\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"more-general-driver-information\">\u003Ca class=\"header-anchor\" href=\"#more-general-driver-information\">More general driver information\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fwww.mongodb.com\u002Fdocs\u002Fdrivers\u002Fnode\u002Fcurrent\u002F\">Visit the MongoDB Driver Docs\u003C\u002Fa>\u003C\u002Fp>\n\u003Ch2 id=\"development-run-with-docker-compose\">\u003Ca class=\"header-anchor\" href=\"#development-run-with-docker-compose\">Development: Run with Docker Compose\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>You can start a local development environment with Node-RED and MongoDB using the included \u003Ccode>docker-compose.yml\u003C\u002Fcode> file. This starts two containers on a shared network and uses named Docker volumes for persistence.\u003C\u002Fp>\n\u003Cp>Start the stack:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">docker compose up -d\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Stop and remove containers:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">docker compose down\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Environment variables are set inside \u003Ccode>docker-compose.yml\u003C\u002Fcode> with example values. For production or CI, replace them with secure values or set them in a \u003Ccode>.env\u003C\u002Fcode> file.\u003C\u002Fp>\n\u003Cp>Node-RED will be available on \u003Ccode>http:\u002F\u002Flocalhost:1880\u003C\u002Fcode>.\u003C\u002Fp>\n",1784738654095]