What's New in 3.x
Web API for MongoDB
RESTHeart is the Web API for MongoDB. Just start it to open MongoDB to the Web via a clean, secure and complete RESTful API.
RESTHeart leverages MongoDB's document-oriented nature, creating an automatic mapping between MongoDB's internal storage of data and a graph of externally accessible HTTP resources, implementing a model of interaction compliant with an HATEOAS (Hypermedia as the Engine of Application State) representation, where the state of a client process is entirely driven by HTTP verbs like GET, POST, PUT, PATCH, DELETE, etc.
- Lightweight Server the API is ready to use and does not require any coding
- Built on standards HTTP, JSON, RESTful, HAL, JSON Schema
- Pluggable Authentication and Authorization with ready to use Identity Managers and role based Access Manager
- Data operations API: create, read, update, delete and query documents
- Support for the dot notation and update operators on every write verb from 2.0
- Bulk operations (POST, PATCH and DELETE multiple documents with one request) from 2.0
- GridFS support binary data with GridFS
- Aggregation Operations supports both map reduce and aggregation pipeline from 2.0
- Data model operations API create dbs, collections and indexes
- Data validation with JSON Schema from 2.0
- WebHook call other web resources after request completes from 2.0
- Relationship can be defined so that documents automatically include the hyperlinks to referenced data
- Transformation and Checks logic can be easily applied to requests
- Supports browser web caching and avoids ghost writes with ETag from 2.0
- Cross-origin resource sharing CORS
- Embedded HAL browser to navigate your data from the browser
What it does
RESTHeart seamlessly connects to MongoDB to securely expose dbs and collections to the web.
Any authorized client (authentication and authorization are provided out-of-the-box) can interact with MongoDB via the RESTHeart API.
documents are read with the GET verb, created and modified with PUT, POST and PATCH verbs and deleted with the DELETE verb.
Data is exchanged as JSON (actually the standard hal+json mediatype).
HAL is a simple format that gives a consistent and easy way to hyperlink between resources in your API.
The following picture depicts a simple usage scenario: a mobile blog reader application sends a GET /blog/posts request to retrive the paginated list of posts.
RESTHeart is implemented in Java 8, on top of the Undertow HTTP server. The complete source code is available on Github.