{"id":42874,"library":"integreat-transporter-mongodb","title":"Integreat Transporter MongoDB","description":"A MongoDB transporter for the Integreat data integration hub, enabling reading from and writing to MongoDB collections. Current stable version is 1.3.0, released with no active release cadence indicated. It acts as a bridge between Integreat pipelines and MongoDB, supporting operations like get, set, delete, and streaming via change streams. Key differentiators: tightly coupled with Integreat's JSON-based action format, supports MongoDB aggregation pipelines for data transformation, and uses a single collection per transporter instance. Designed for Node.js 18.18+ with ESM support.","status":"active","version":"1.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/integreat-io/integreat-transporter-mongodb","tags":["javascript"],"install":[{"cmd":"npm install integreat-transporter-mongodb","lang":"bash","label":"npm"},{"cmd":"yarn add integreat-transporter-mongodb","lang":"bash","label":"yarn"},{"cmd":"pnpm add integreat-transporter-mongodb","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"MongoDB driver for database interactions","package":"mongodb","optional":false},{"reason":"Peer dependency for Integreat pipeline integration","package":"integreat","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require() will fail.","wrong":"const transporter = require('integreat-transporter-mongodb')","symbol":"default","correct":"import transporter from 'integreat-transporter-mongodb'"},{"note":"The package exports a default class; named import is incorrect.","wrong":"import { TransporterMongodb } from 'integreat-transporter-mongodb'","symbol":"TransporterMongodb","correct":"import TransporterMongodb from 'integreat-transporter-mongodb'"},{"note":"TypeScript type exported as named export; valid for type-only imports.","wrong":null,"symbol":"type TransporterOptions","correct":"import type { TransporterOptions } from 'integreat-transporter-mongodb'"}],"quickstart":{"code":"import integrert from 'integreat';\nimport transporter from 'integreat-transporter-mongodb';\n\nconst great = integrert({\n  transporters: [\n    transporter({\n      uri: process.env.MONGODB_URI ?? 'mongodb://localhost:27017',\n      db: 'mydb',\n      collection: 'mycollection'\n    })\n  ]\n});\n\nawait great.transport({\n  type: 'set',\n  payload: { id: '123', data: { name: 'Alice' } }\n});\n\nconst result = await great.transport({\n  type: 'get',\n  payload: { id: '123' }\n});\nconsole.log(result.data); // { id: '123', name: 'Alice' }","lang":"typescript","description":"Sets up Integreat with MongoDB transporter, inserts a document, and retrieves it."},"warnings":[{"fix":"Instantiate multiple transporters with different collection names.","message":"The transporter uses a single MongoDB collection per instance; you must create separate transporter instances for different collections.","severity":"gotcha","affected_versions":">0"},{"fix":"Upgrade Node.js to >=18.18 and use ESM imports (import/export).","message":"Version 1.0.0 dropped support for Node.js <18.18 and switched to ESM-only exports.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Always wrap MongoDB operations in Integreat action objects with type (get, set, delete).","message":"The transporter expects actions in Integreat's JSON format; providing raw MongoDB queries may cause unexpected behavior.","severity":"gotcha","affected_versions":">0"},{"fix":"Use 'uri' instead of 'connString' in transporter options.","message":"Option 'connString' used in v0.x was renamed to 'uri' in v1.0.0.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.3.0':25 '18.18':84 'act':34 'action':64 'activ':29 'aggreg':68 'base':63 'bridg':37 'cadenc':31 'chang':52 'collect':20,77 'coupl':57 'current':21 'data':10,71 'delet':48 'design':81 'differenti':55 'enabl':13 'esm':86 'format':65 'get':46 'hub':12 'indic':32 'instanc':80 'integr':11 'integreat':1,9,39,59 'javascript':88 'json':62 'json-bas':61 'key':54 'like':45 'mongodb':3,5,19,42,67 'node.js':83 'oper':44 'per':78 'pipelin':40,69 'read':14 'releas':26,30 'set':47 'singl':76 'stabl':22 'stream':50,53 'support':43,66,87 'tight':56 'transform':72 'transport':2,6,79 'use':74 'version':23 'via':51 'write':17","created_at":"2026-06-05T16:57:05.140652+00:00","updated_at":"2026-06-05T16:57:05.140652+00:00","problems":[{"fix":"Switch to ESM imports or use dynamic import().","cause":"Package is ESM-only and cannot be used with require() in CommonJS projects.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/integreat-transporter-mongodb/lib/index.js from /path/to/index.js not supported."},{"fix":"Use `import transporter from 'integreat-transporter-mongodb'` (no braces).","cause":"Importing the default export incorrectly, e.g., using destructuring.","error":"TypeError: transporter is not a function"},{"fix":"Ensure the Integreat instance is started by calling `await great.start()` after setup.","cause":"MongoDB connection not established before first operation.","error":"MongoDB error: MongoNotConnectedError: Client must be connected before running operations"},{"fix":"Include `collection: 'yourCollectionName'` in transporter options.","cause":"The 'collection' option is mandatory but was omitted.","error":"TypeError: Missing required parameter 'collection' in transporter options"}],"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/integreat-io/integreat-transporter-mongodb#readme","github":"https://github.com/integreat-io/integreat-transporter-mongodb","docs":null,"changelog":null,"pypi":null,"npm":"integreat-transporter-mongodb","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}}