Learn about Feathers database adapters and how to connect your application to various databases including MongoDB, SQL, and in-memory storage.
Feathers provides a powerful adapter system that allows you to connect your services to different databases using a consistent API. All adapters share common patterns and querying capabilities while supporting database-specific features.
const service = new MongoDBService({ Model: collection, paginate: { default: 10, // Default page size max: 50 // Maximum page size }})
Paginated responses include:
interface Paginated<T> { total: number // Total count of matching records limit: number // Page size skip: number // Number of records skipped data: T[] // Array of results}
By default, patch and remove without an ID will throw an error. Enable multi operations:
const service = new MongoDBService({ Model: collection, multi: true // Allow all multi operations})// Or enable for specific methods onlyconst service = new MongoDBService({ Model: collection, multi: ['patch', 'remove']})// Now you can patch/remove multiple recordsawait service.patch(null, { status: 'archived' }, { query: { active: false }})