• <bdo id='LbTw5'></bdo><ul id='LbTw5'></ul>
      <legend id='LbTw5'><style id='LbTw5'><dir id='LbTw5'><q id='LbTw5'></q></dir></style></legend>

      <tfoot id='LbTw5'></tfoot>

    1. <small id='LbTw5'></small><noframes id='LbTw5'>

      1. <i id='LbTw5'><tr id='LbTw5'><dt id='LbTw5'><q id='LbTw5'><span id='LbTw5'><b id='LbTw5'><form id='LbTw5'><ins id='LbTw5'></ins><ul id='LbTw5'></ul><sub id='LbTw5'></sub></form><legend id='LbTw5'></legend><bdo id='LbTw5'><pre id='LbTw5'><center id='LbTw5'></center></pre></bdo></b><th id='LbTw5'></th></span></q></dt></tr></i><div id='LbTw5'><tfoot id='LbTw5'></tfoot><dl id='LbTw5'><fieldset id='LbTw5'></fieldset></dl></div>

        ORM 与 NoSQL API 是多余的吗?

        时间:2023-07-10
        <legend id='H2glW'><style id='H2glW'><dir id='H2glW'><q id='H2glW'></q></dir></style></legend>

              • <bdo id='H2glW'></bdo><ul id='H2glW'></ul>
                  <tbody id='H2glW'></tbody>

                1. <tfoot id='H2glW'></tfoot>
                2. <small id='H2glW'></small><noframes id='H2glW'>

                  <i id='H2glW'><tr id='H2glW'><dt id='H2glW'><q id='H2glW'><span id='H2glW'><b id='H2glW'><form id='H2glW'><ins id='H2glW'></ins><ul id='H2glW'></ul><sub id='H2glW'></sub></form><legend id='H2glW'></legend><bdo id='H2glW'><pre id='H2glW'><center id='H2glW'></center></pre></bdo></b><th id='H2glW'></th></span></q></dt></tr></i><div id='H2glW'><tfoot id='H2glW'></tfoot><dl id='H2glW'><fieldset id='H2glW'></fieldset></dl></div>
                3. 本文介绍了ORM 与 NoSQL API 是多余的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  使用 MongoDB(我认为其他 NoSQL 数据库 API 值得一试)查询数据库的方式比 SQL 简单得多.无需生成繁琐的 SQL 查询等.例如从 mongodb-csharp 获取这个:

                  with MongoDB (and I assume other NoSQL database APIs worth their salt) the ways of querying the database are much more simplistic than SQL. There is no tedious SQL queries to generate and such. For instance take this from mongodb-csharp:

                  using MongoDB.Driver; 
                  Mongo db = new Mongo(); 
                  db.Connect(); //Connect to localhost on the default port. 
                  Document query = new Document(); 
                  query["field1"] = 10; 
                  Document result = db["tests"]["reads"].FindOne(query); 
                  db.Disconnect();
                  

                  ORM 怎么能简化呢?在体面的 NoSQL API 之上是否需要 ORM 或其他数据库抽象设备"?

                  How could an ORM even simplify that? Is an ORM or other "database abstraction device" required on top of a decent NoSQL API?

                  推荐答案

                  嗯,是的,对象-关系映射器对于 MongoDB 来说是多余的,因为 MongoDB 不是关系数据库,它是一个面向文档的数据库.

                  Well, yes, Object-Relational mappers are redundant with MongoDB because MongoDB isn't a relational database, it's a Document-Oriented database.

                  因此,您可以用 JSON 编写查询,而不是 SQL.除非你真的,真的想要编写原始 JSON,而不是 Linq,那么你仍然会想要使用映射器.如果你不想创建与 MongoDB 本身的耦合,那么你不想传递实际的 Document 对象,你想将它们映射到真正的 POCO.

                  So instead of SQL, you write queries in JSON. Unless you really, really want to write raw JSON, as opposed to, say, Linq, then you're still going to want to use a mapper. And if you don't want to create coupling against MongoDB itself, then you don't want to pass actual Document objects around, you want to map them to real POCOs.

                  使用像 MongoDB 这样的面向文档的数据库,映射要更容易,因为你有嵌套的文档而不是关系,但这并不意味着它会完全消失.这只是意味着你用一种阻抗失配"代替了另一种稍微不那么戏剧性的失配.

                  The mapping is much easier with a document-oriented DB like MongoDB, because you have nested documents instead of relations, but that doesn't mean it goes away completely. It just means you've substituted one type of "impedance mismatch" for a different, slightly-less-dramatic mismatch.

                  这篇关于ORM 与 NoSQL API 是多余的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:哪些 .NET 兼容的图形数据库解决方案具有良好的业绩记录? 下一篇:如何将水晶报表绑定到手动创建的数据集

                  相关文章

                  1. <legend id='3O8KS'><style id='3O8KS'><dir id='3O8KS'><q id='3O8KS'></q></dir></style></legend>
                        <bdo id='3O8KS'></bdo><ul id='3O8KS'></ul>
                      <i id='3O8KS'><tr id='3O8KS'><dt id='3O8KS'><q id='3O8KS'><span id='3O8KS'><b id='3O8KS'><form id='3O8KS'><ins id='3O8KS'></ins><ul id='3O8KS'></ul><sub id='3O8KS'></sub></form><legend id='3O8KS'></legend><bdo id='3O8KS'><pre id='3O8KS'><center id='3O8KS'></center></pre></bdo></b><th id='3O8KS'></th></span></q></dt></tr></i><div id='3O8KS'><tfoot id='3O8KS'></tfoot><dl id='3O8KS'><fieldset id='3O8KS'></fieldset></dl></div>
                      <tfoot id='3O8KS'></tfoot>

                      <small id='3O8KS'></small><noframes id='3O8KS'>