- MongoDB 4 Quick Start Guide
- Doug Bierer
- 103字
- 2021-08-13 15:25:03
Embedded documents
A better data-modeling solution would be simply to collapse the normalized relationships and fold the related information into embedded (https://docs.mongodb.com/manual/core/data-model-design/#data-modeling-embedding) documents. Using the preceding example, the better solution would appear as follows:

Using embedded documents, with a single query, you can easily obtain a consolidated block of information, which includes the customer name, purchase date, and specifics on the item.
MongoDB also supports creating indexes ( https://docs.mongodb.com/manual/indexes/) on any given field, which boosts query performance. The auto-generated _id field is automatically indexed. It should be noted, however, that creating too many indexes will have a negative impact on performance when writing data.
推薦閱讀
- 自動控制工程設計入門
- Ansible Quick Start Guide
- 教父母學會上網
- 數控銑削(加工中心)編程與加工
- 數據庫原理與應用技術
- RPA(機器人流程自動化)快速入門:基于Blue Prism
- Learning C for Arduino
- INSTANT Drools Starter
- 工業機器人安裝與調試
- HTML5 Canvas Cookbook
- 從零開始學SQL Server
- Apache源代碼全景分析(第1卷):體系結構與核心模塊
- Mastering Ansible(Second Edition)
- 工業機器人力覺視覺控制高級應用
- Effective Business Intelligence with QuickSight