Gatsby source plugin for pulling data from MongoDB collections into the Gatsby data layer. Current stable version 5.16.0 supports Gatsby 5 and Node >=18.0.0 <26. It connects to MongoDB (local, Atlas, or custom) and ingests documents as Gatsby nodes. Supports multiple collections, custom queries, type prefixing, and field mapping for transformer plugins (e.g., markdown to HTML). Differentiators include built-in compatibility with MongoDB Atlas, flexible authentication, and options for preserving ObjectIDs. Release cadence follows Gatsby's major releases.
npm install gatsby-source-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures the plugin to source MongoDB data from a local instance using environment variables for authentication.
Set `clientOptions: { useNewUrlParser: false, useUnifiedTopology: false }` or a valid driver option.Include `dbName` in options even when using connectionString.
Use `preserveObjectIds: true` (Boolean, not string).
Run `npm install gatsby-source-mongodb`
Start MongoDB service or check connection options.