RESTHeart Documentation

version 3.x

Authors

Andrea Di Cesare, Maurizio Turatti

RESTHeart is an open source project created and developed by SoftInstigate.

What's New in 3.x

  • Representation of resources is now simpler. User can choose HAL or Plain Json (at request level or in the global configuration).
  • Deep refactoring to use the new MongoDB driver version 3
  • Representation Transformers can now apply on any type of requests (see task RH-208, task RH-211 and task RH-213)
  • More robust code, more tests and several bug fixes.
  • See complete list of improvements at 3.0 version jira log


GET /db/coll?filter={"improved": true}

{   "_embedded": [
       {"_id": "quality", "improved": true },
       {"_id": "robustness", "improved": true },
       {"_id": "performance", "improved": true },
       {"_id": "features set", "improved": true } 
    ],
	"_id": "coll", 
    "_returned": 4
    "_etag": { "$oid": "58469e93410df80006263d11" }
}



If you have questions please post them as Github issues or on Stackoverflow.

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.

- from https://en.wikipedia.org/wiki/RESTHeart

Features

  • Lightweight Server the API is ready to use and does not require any coding
  • Built on standards HTTP, JSON, RESTful, HALJSON 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
  • Serve Static Resources (such as html and javascript) and custom Application Logic
  • 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. 


Source code

RESTHeart is implemented in Java 8, on top of the Undertow HTTP server. The complete source code is available on Github.

  

Popular Topics

Recently Updated Pages