Does MongoDB have a native REST interface?

Mayank Jain picture Mayank Jain · Sep 12, 2011 · Viewed 53.8k times · Source

I am currently evaluating Mongo and CouchDB for storing data points (analytics).

During my earlier interaction with CouchDB, I loved its JSONP based interface. I could perform all CRUD operations from purely JavaScript. Just run CouchDB and write some JavaScript - no server side component needed.

When comparing this to Mongo, is there any REST interface available? Is it possible to do CRUD purely from javascript in Mongo?

Thanks!

Answer

Tomasz Nurkiewicz picture Tomasz Nurkiewicz · Sep 12, 2011

There is no full-blown REST interface to MongoDB, mainly because the server uses native binary protocol for efficiency. You can find few REST wrappers in official documentation (edit: MongoDB inc has now deleted this information):

  • RESTHeart (Java 8) is a the data REST API server part of the MongoDB ecosystem. RESTHeart uses a standard representation format based on HAL with full native mongodb data support via the strict mode representation of BSON. It provides API for CRUD and data model operations, built-in authentication and authorization and it supports CORS. It is easy to setup and a docker container is available. RESTHeart is also fast and lightweight (~7 Mb footprint and ~200 Mb RAM peek usage).
  • Sleepy Mongoose (Python) is a full featured REST interface for MongoDB which is available as a separate project.
  • Simple REST Interface The mongod process includes a simple read-only REST interface for convenience. For full REST capabilities we recommend using an external tool such as Sleepy.Mongoose.