A MongoDB driver for the webiny-entity ORM, providing a persistent storage backend for entity objects. Current stable version is 1.15.1. It wraps the official MongoDB Node.js driver (peer dependency mongodb ^3.1.13) and integrates seamlessly with webiny-entity, offering features like automatic collection management, query building, and attribute persistence. Designed specifically for the Webiny framework but usable standalone. Low release cadence; primarily for internal Webiny JS usage.
npm install webiny-entity-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to a local MongoDB instance, creates a driver instance, saves and retrieves a user entity.
Ensure you pass `{ db: mongoClient.db(dbName) }`.Define `static entityName = 'EntityClassName'` in your entity class.
Use `driver.save(entity, { beforeSave: fn, afterSave: fn })` instead.const db = client.db('mydb'); const driver = new WebinyEntityMongoDb({ db });Add `static entityName = 'MyEntity';` to the entity class.
Use `import WebinyEntityMongoDb from 'webiny-entity-mongodb'`.