Adapter for node-simple-odata-server that provides MongoDB persistence. Version 1.0.0 is stable but has infrequent updates (last release in 2023). It maps OData queries to MongoDB operations, supporting filtering, sorting, and pagination. Unlike generic OData servers, this integrates directly with the simple-odata-server ecosystem and uses native MongoDB driver. Minimal dependencies; requires mongodb v4+ and simple-odata-server v2+.
npm install simple-odata-server-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up an OData endpoint with MongoDB adapter using Express, defines a simple Product entity, and listens on port 3000.
Pass db = client.db('name') instead of a single collection.Upgrade to mongodb v4+ or use an older version of this adapter (0.x).
Implement custom handling or avoid $expand in queries.
Use '_id' as key field in model definition.
Use `import adapter from 'simple-odata-server-mongodb'` or `const adapter = require('simple-odata-server-mongodb').default` (CJS).Ensure you pass a MongoDB connection URI string to MongoClient.connect, then use client.db().
Use `adapter(db)` where db = client.db('databaseName').