• 在规范化数据模型中,地址文件包含对顾客文件的引用。 ```json // patron document { _id: “joe”, name: “Joe Bookreader” }

    // address documents { patron_id: “joe”, // reference to patron document street: “123 Fake Street”, city: “Faketon”, state: “MA”, zip: “12345” }

    { patron_id: “joe”, street: “1 Some Other Street”, city: “Boston”, state: “MA”, zip: “12345” }

    1. - 如果应用程序经常使用名称信息检索地址数据,则您的应用程序需要发出多个查询来解析引用。 更好的方案是将地址数据实体嵌入到顾客数据中
    2. ```json
    3. {
    4. "_id": "joe",
    5. "name": "Joe Bookreader",
    6. "addresses": [
    7. {
    8. "street": "123 Fake Street",
    9. "city": "Faketon",
    10. "state": "MA",
    11. "zip": "12345"
    12. },
    13. {
    14. "street": "1 Some Other Street",
    15. "city": "Boston",
    16. "state": "MA",
    17. "zip": "12345"
    18. }
    19. ]
    20. }