Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
172 views
in Technique[技术] by (71.8m points)

javascript - Does MongoDB have a native REST interface?

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...