MongoDB management helpers for Feathers v5 (Koa) applications, written in TypeScript. Version 2.3.2 provides utilities for database administration tasks such as creating indexes, managing collections, and running migrations against a MongoDB instance via Feathers services. It leverages the official MongoDB Node.js driver and Feathers' hook and service patterns. Released regularly, it is designed specifically for Feathers v5 and TypeScript users, offering type-safe methods compared to generic MongoDB management scripts. Key differentiators: tight integration with Feathers 5's dependency injection and hooks, full TypeScript support, and focus on common admin operations.
npm install feathers-mongodb-management-tsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Registers the ManagementService and uses createIndexes to add indexes to the 'users' collection. Assumes a Feathers v5 app with MongoDB connection.
Update to `new ManagementService({ db: connectionString })` and pass any additional options like `options`.Use ES import syntax or `const pkg = require('feathers-mongodb-management-ts').default`.Use `app.service('management').remove('collectionName')` instead of `dropCollection(service, 'collectionName')`.Ensure your connection is established before calling any management methods, or pass a connected `MongoClient` instance via `{ client }`.Remove `background: true` for MongoDB >=4.2 or rely on the driver's default behavior.
Use `import { createIndexes } from 'feathers-mongodb-management-ts'`.Pass an object with `db` key: `new ManagementService({ db: 'mongodb://...' })`.Use `import type { ManagementType } from '...'` and ensure it's used as a type only.