MongoDB DEV · 题目 217 · 多选

Consider an entity containing a user and another entity containing the shipping address for this user. Which of the following statements are true about the representation of a one-to-one relationship between the user and the shipping address? Check all that apply:

题目选项

  1. A.
    Embedding the shipping address in the user adds complexity in developing the application
  2. B.
    If the shipping address is rarely-used, referencing the user in the shipping address may help reduce the amount of data in RAM
  3. C.
    Embedding the shipping address in the user document is a recommended representation for simplicity

答案置信度:高

正确答案:C

解析语言:中文

一对多/一对一关系的默认建议是把从属实体嵌入主文档(把收货地址嵌进用户文档),实现简单且一次读取就能取回全部数据,所以 A 正确;B 说“增加开发复杂度”与事实相反。C 描述的是“很少访问的大字段可以拆出去用引用降低工作集”这一思路,但本题问的是这对一对一关系的推荐表示,标准答案仍是嵌入(数据库中该题的答案键对应的就是 A 这一项)。

所在套题

此题在题库中有 3 条记录。公开详情合并相同题干和选项;完整公开题展示置信度最高的一条记录,其他题目仅展示摘要。按套学习保留每条记录原有的答案、解析和置信度。

作者 · 作品 · 开源

作者与 MongoDB 作品

专注数据平台、MongoDB 迁移同步与云运维产品研发。

有任何 MongoDB 需求,均可联系作者。

联系作者 ↗mlhp123@outlook.com

支持作者

如果题库对您有帮助,欢迎自愿扫码打赏。

支付宝扫码打赏作者打开打赏原图 ↗