官术网_书友最值得收藏!

  • MongoDB 4 Quick Start Guide
  • Doug Bierer
  • 194字
  • 2021-08-13 15:25:03

Documents, collections, and database

In order fully to understand how to use MongoDB, it is important to discuss the terms used to describe MongoDB data structures: documents, fields, and collections. The following table summarizes these three terms by way of illustration. In this table, we also draw an equivalence between MongoDB and RDBMS (Relational Database Management Systems):

 

In the preceding example, we see a document that represents information about a member whose name is Smith. Within the document are fields, the example highlighted being cost. Documents that are stored together for a single logical purpose represent a collection. A MongoDB database consists of one or more collections.

The astute reader will no doubt notice the lack of the MongoDB equivalent to a traditional RDBMS primary key. In the RDBMS, it is mandatory for the database developer to define one or more columns as the primary key in order to identify a given row uniquely. This is not required in MongoDB, as a unique identifying field _id is automatically added when the document is inserted into a collection. This field comprises an ObjectId ( https://docs.mongodb.com/manual/reference/glossary/#term-objectid) instance and uses a combination of factors to guarantee uniqueness.
主站蜘蛛池模板: 定边县| 堆龙德庆县| 乌兰县| 教育| 德钦县| 吉木乃县| 三台县| 吉隆县| 仁寿县| 云阳县| 巴彦淖尔市| 呼图壁县| 新余市| 秀山| 元江| 阆中市| 荔浦县| 岳普湖县| 江源县| 金阳县| 兴安盟| 平果县| 台中市| 武城县| 修水县| 寿阳县| 卢湾区| 理塘县| 开平市| 沾益县| 绍兴市| 裕民县| 盈江县| 通山县| 固阳县| 昌吉市| 蒲江县| 黄大仙区| 胶南市| 黄陵县| 锦屏县|