Odatafy Documentation
This page contains the documentation for the odatafy ecosystem. It focuses on the core module, odatafy-parser, and gives an overview over the plugins, which are documented in their respective README files. This documentation only covers the odatafy-parser support of the oData v4 query options in the Feature-Support section. For the feature documentations of the plugins, please refer to their respective documentation. If you want to learn how the query options work, please refer to the oData v4 URL documentation.
What is odatafy?
Odatafy is an ecosystem of npm modules that aim to help you create oDatav4 compatible REST-APIs, thus allowing you to accelerate development and save time and money by helping you to implement an API that is based on the very-well established oData v4 standard. As it is by far the most tideous task, odatafy currently only supports query operations.
How does odatafy work?
The odatafy ecosystem is composed mainly of three parts: the core, plugins and showcases.
The core
The core is the odatafy-parser npm module, which is a parser consisting of multiple peg.js grammars working together to parse an oData v4 URL and translate it into an Abstract Syntax Tree (AST). The structure of this AST is documented in the oDataParseResult section of our typedoc documentation. Now you could use the core on its own and program a translator for database queries on top of the AST. Luckily, we already did this for you by offering Plugins.
Plugins
Plugins are the most essential part of developing an application with odatafy. Plugins are npm packages built on top of the AST, that the odatafy-parser provides. Currently, we are maintaining two plugins:
- odatafy-mongodb: Convert odata v4 requests to MongoDB Aggregation Queries with the parseODataUrl()
function
- odatafy-mongoose: Effortlessly generate Service Metadata Files and Expand Mappings for odatafy-mongodb from mongoose schemas
Showcases
Finally, to bring it all together, we have created a few applications using the odatafy ecosystem for you to play around with and to guide you through using odatafy in your application.
- odatafy-mongodb-example: A simple RESTful API leveraging all available plugins. Feel free to try out some odata queries here!
- odatafy-flutter-app: A flutter app built on top of the odatafy-mongodb-example app that dynamically generates an admin dashboard for data querying and manipulation based on the Service Metadata and oDatav4 API provided by odatafy-mongodb and odatafy-mongoose.