https://docs.mongodb.com/getting-started/csharp/introduction/

MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling.

MongoDB obviates the need for an Object Relational Mapping (ORM) to facilitate development.

Documents

A record in MongoDB is a document, which is a data structure composed of field and value pairs.

MongoDB documents are similar to JSON objects.

The values of fields may include other documents, arrays, and arrays of documents.

{
"_id" : ObjectId("54c955492b7c8eb21818bd09"),
"address" : {
"street" : "2 Avenue",
"zipcode" : "10075",
"building" : "1480",
"coord" : [ -73.9557413, 40.7720266 ]
},
"borough" : "Manhattan",
"cuisine" : "Italian",
"grades" : [
{
"date" : ISODate("2014-10-01T00:00:00Z"),
"grade" : "A",
"score" : 11
},
{
"date" : ISODate("2014-01-16T00:00:00Z"),
"grade" : "B",
"score" : 17
}
],
"name" : "Vella",
"restaurant_id" : "41704620"
}

Collections

MongoDB stores documents in collections.

Collections are analogous to tables in relational databases.

Unlike a table, however, a collection does not require its documents to have the same schema.

In MongoDB, documents stored in a collection must have a unique _id field that acts as a primary key

primary key

A record’s unique immutable identifier.

In an RDBMS, the primary key is typically an integer stored in each row’s id field.

In MongoDB, the _id field holds a document’s primary key which is usually a BSON ObjectId.

RDBMS

Relational Database Management System.

A database management system based on the relational model, typically using SQL as the query language.

SQL

Structured Query Language (SQL) is a common special-purpose programming language used for interaction with a relational database, including access control, insertions, updates, queries, and deletions.

There are some similar elements in the basic SQL syntax supported by different database vendors, but most implementations have their own dialects方言, data types, and interpretations解释 of proposed SQL standards.

Complex SQL is generally not directly portable手提的,便携式的,轻便的 between major RDBMS products. SQL is often used as metonym换喻中所使用的词或短语 for relational databases.

_id

A field required in every MongoDB document.

The _id field must have a unique value.

You can think of the_id field as the document’s primary key.

If you create a new document without an _id field, MongoDB automatically creates the field and assigns a unique BSON ObjectId.

document

A record in a MongoDB collection and the basic unit of data in MongoDB.

Documents are analogous类似 toJSON objects but exist in the database in a more type-rich format known as BSON. See Documents.

collection

A grouping of MongoDB documents.

A collection is the equivalent of an RDBMS table.

A collection exists within a single database.

Collections do not enforce a schema.

Documents within a collection can have different fields.

Typically, all documents in a collection have a similar or related purpose. See Namespaces.

ObjectId

A special 12-byte BSON type that guarantees uniqueness within the collection.

The ObjectId is generated based on timestamp, machine ID, process ID, and a process-local incremental counter.

MongoDB uses ObjectId values as the default values for _id fields.

总结

在MongoDB中,一条记录,就是一个Document,Document是由很多"字段-值"的构成的。【对应关系型数据库中表的一行】

字段的值可以是其他的Document,数组,或者由Document组成的数组。

每一个Document都有一个_id字段,如果你不赋值,MongoDB会自动生成一个值

MongoDB把Document存储在Collection中,Collection等同于关系型数据库中的Table。

Collection不要求Document保持相同的格式,但是一般来讲,一个Collection中的Document会保持相同的格式。

Introduction to MongoDB的更多相关文章

  1. MongoDB - Introduction to MongoDB, MongoDB Extended JSON

    JSON can only represent a subset of the types supported by BSON. To preserve type information, Mongo ...

  2. MongoDB - Introduction to MongoDB

    MongoDB is an open-source document database that provides high performance, high availability, and a ...

  3. MongoDB - Introduction to MongoDB, Capped Collections

    Overview Capped collections are fixed-size collections that support high-throughput operations that ...

  4. MongoDB - Introduction to MongoDB, Documents

    MongoDB stores data records as BSON documents. BSON is a binary representation of JSON documents, th ...

  5. MongoDB - Introduction to MongoDB, BSON Types

    BSON is a binary serialization format used to store documents and make remote procedure calls in Mon ...

  6. MongoDB - Introduction to MongoDB, Databases and Collections

    MongoDB stores BSON documents, i.e. data records, in collections; the collections in databases. Data ...

  7. Table of Contents - MongoDB

    Getting Started Installation Installing MongoDB on Windows Installing MongoDB on Linux Introduction ...

  8. MongoDB学习day04--NodeJs操作数据库增删改查

    一.在Nodejs中使用Mongodb Nodejs需要引入的包 npm install mongodb --save -dev 或者使用镜像 cnpm install mongodb --save ...

  9. Getting Started with MongoDB (MongoDB Shell Edition)

    https://docs.mongodb.com/getting-started/shell/ Overview Welcome to the Getting Started with MongoDB ...

随机推荐

  1. 创业笔记-Node.js入门之JavaScript与Node.js

    JavaScript与Node.js JavaScript与你 抛开技术,我们先来聊聊你以及你和JavaScript的关系.本章的主要目的是想让你看看,对你而言是否有必要继续阅读后续章节的内容. 如果 ...

  2. Spring boot 使用@Value注入属性

    Spring boot 使用@Value注入属性 学习了:http://blog.csdn.net/hry2015/article/details/72353994 如果启动的时候报错: spring ...

  3. OC的动态继承编译机制

    [问]为什么OC不能sizeof一个对象的大小或一个类的大小?和类结构相近的结构体却能够. [再问]为什么OC不能将对象声明到静态空间,如栈中?和类结构相近的结构体却能够. [答]由于OC的动态继承编 ...

  4. ios修改了coredata数据结构后,更新安装会闪退

    如果iOS App 使用到CoreData,并且在上一个版本上有数据库更新(新增表.字段等操作),那在覆盖安装程序时就要进行CoreData数据库的迁移,具体操作如下: 1.选中你的mydata.xc ...

  5. hdoj--3592--World Exhibition(差分约束)

    World Exhibition Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  6. 如何做到Ubuntu14.04下的mongdb远程访问?(图文详解)

    不多说,直接上干货! 本教程详细指导大家如何开启并设置用户权限.MongoDB默认是没有开启用户权限的,如果直接在公网服务器上如此搭建MongoDB,那么所有人都可以直接访问并修改数据库数据了. 其实 ...

  7. SharePoint 使用Expression Web 设计网站

    创建好网站以后可就可以开始发布了 possible causes : 1.The web server may not hava the FrontPage Server Extensions ins ...

  8. (转载)android 一些工具类汇总

    android 一些工具类汇总 作者:曾田生z 字体:[增加 减小] 类型:转载 时间:2016-08-14我要评论 本文给大家汇总介绍了一些常用的Android工具类,非常的简单实用,有需要的小伙伴 ...

  9. 【转载】Reactor模式和NIO

    当前分布式计算 Web Services盛行天下,这些网络服务的底层都离不开对socket的操作.他们都有一个共同的结构:1. Read request2. Decode request3. Proc ...

  10. 【原创】使用Kettle的一些心得和经验

    用kettle做etl也有段时间了,遇到很多问题,总结了一下. [关于版本的问题] kettle常用的版本有4.1和4.4,对于4.1版本: 1.该版本的兼容性有点差,在某些机器上运行会启动失败,或者 ...