MongoDB 有原生的 REST 接口吗? [英] Does MongoDB have a native REST interface?

查看:30
本文介绍了MongoDB 有原生的 REST 接口吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在评估 Mongo 和 CouchDB 用于存储数据点(分析).

在我早期与 CouchDB 的交互中,我喜欢它基于 JSONP 的界面.我可以从纯 JavaScript 执行所有 CRUD 操作.只需运行 CouchDB 并编写一些 JavaScript - 不需要服务器端组件.

将其与 Mongo 进行比较时,是否有可用的 REST 接口?是否可以完全从 Mongo 中的 javascript 执行 CRUD?

谢谢!

解决方案

MongoDB 没有成熟的 REST 接口,主要是因为服务器使用原生二进制协议来提高效率.您可以在官方 文档 中找到几个 REST 包装器(MongoDB inc 现在有删除了此信息):

<块引用>
  • RESTHeart (Java 8) 是 MongoDB 生态系统的数据 REST API 服务器部分.RESTHeart 使用基于 HAL 的标准表示格式,通过 BSON 的严格模式表示具有完整的原生 mongodb 数据支持.为CRUD和数据模型操作提供API,内置认证和授权,支持CORS.它很容易设置,并且有一个 docker 容器可用.RESTHeart 还快速且轻量级(约 7 Mb 的占用空间和约 200 Mb 的 RAM 使用量).

<块引用>

  • 瞌睡猫鼬 (Python) 是 MongoDB 的全功能 REST 接口,可作为单独的项目使用.

<块引用>

<块引用>

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!

解决方案

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.

这篇关于MongoDB 有原生的 REST 接口吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆