为什么在NoSql中使用ORM(例如MongoDB) [英] why the use of an ORM with NoSql (like MongoDB)

查看:218
本文介绍了为什么在NoSql中使用ORM(例如MongoDB)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,但这有意义吗? ORM的意思是:对象关系映射器,这里有关系,而NoSql不是RDBMS!那么,为什么要在NoSql解决方案中使用ORM?因为我看到了适用于Python的ORM更新!

sorry, but does this make sense? the ORM means: Object Relational Mapper, and here, there is Relational, and NoSql is not RDBMS! so why the use of an ORM in a NoSql solution? because i see updates of ORMs for Python!

推荐答案

首先,它们不是ORM(因为它们之间没有任何关系),它们是 ODM (对象文档映射器) )

Firstly, they are not ORM (since they don't have any relations among them), they are ODM (Object Document Mapper)

这些ODM框架的主要用法与ORM的某些共同特征相同,因此

Main usage of these ODM frameworks here same as the some common feature of ORM, thus

  • 在数据模型上提供抽象.无论目标软件是什么,都可以在应用程序中对数据建模.
  • 大多数ODM的构建都是利用现有的语言功能,并使用熟悉的模式来操纵数据,而不是学习新软件的新语言语法.

当我使用monongoid(mongo的Ruby ODM)时,我可以查询mongo的方式(主要是在活动模型中).

When i use mongoid (Ruby ODM for mongo), i can query mongo the way i do it in active model (mostly).

由于它们之间没有关系,因此这些ODM提供了在模型中定义关系并模拟关系的方法.这些都是从开发人员那里抽象出来的,因此他们可以使用与关系数据相同的方式进行编码.

Since they don't have the relation among them, these ODM's provide the way to define the relations in your models and simulate the relationships. These are all abstracted from the developer so they can code the same way they do with the relational data.

这篇关于为什么在NoSql中使用ORM(例如MongoDB)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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