- 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.
推薦閱讀
- R Data Mining
- Dreamweaver CS3網(wǎng)頁(yè)制作融會(huì)貫通
- CSS全程指南
- OpenStack Cloud Computing Cookbook(Second Edition)
- 人工智能與人工生命
- CompTIA Linux+ Certification Guide
- 可編程序控制器應(yīng)用實(shí)訓(xùn)(三菱機(jī)型)
- 基于32位ColdFire構(gòu)建嵌入式系統(tǒng)
- HTML5 Canvas Cookbook
- FPGA/CPLD應(yīng)用技術(shù)(Verilog語(yǔ)言版)
- 奇點(diǎn)將至
- Mastering Ansible(Second Edition)
- 實(shí)戰(zhàn)Windows Azure
- 精通ROS機(jī)器人編程(原書(shū)第2版)
- 實(shí)戰(zhàn)突擊