odata-resource is a Node.js module (v2.0.0, released 2018-06-03) for building REST APIs with Express, Mongoose, and OData query support. It provides a Resource class that wraps a Mongoose model and automatically generates CRUD routes with OData-like query parameters ($filter, $orderby, $select, $expand, $top, $skip). Key differentiators: minimal boilerplate, support for static and instance-based relationships, custom operators (in, notin), and high customizability. Development appears stable but low activity; last release over 6 years ago. Not recommended for new projects; consider alternatives like odata-v4 or feathers-odata for modern OData support.
npm install odata-resourceNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic setup with Express, Mongoose model, and Resource initialization. Shows how to define a model and expose CRUD routes with OData query support.
Store a lower-case copy of the property if case-insensitive filtering is needed.
Use alternative packages like odata-v4 or feathers-odata for current OData support.
Rewrite filter to avoid mixing logical operators in the same parentheses, e.g., use nested groups or separate conditions.
Document API extensions for consumers or use standard OData alternatives like 'any' for collections.
Run 'npm install odata-resource' in the project directory.
Use 'var Resource = require('odata-resource');' without .Resource property.Ensure new Resource({ rel: '/path', model: mongooseModel }) is called with correct arguments.