【发布时间】:2023-03-18 10:58:01
【问题描述】:
我在一次采访中被问到这个问题,但不知道答案。 “您正在设计一个 monogdb 架构来支持包含查找的查询。您应该怎么做?”
选项是
Create a multicolumn index on
a) key value used as primary and foreign key
b) foreign key and most unique column
[ b was my answer because i thought it would avoid collisions. Intereviewer disagreed, didn't tell me the answer.]
OR-
c) Create an index on the key value used as the foreign key
d) Create an index on the key value used as primary key
面试官不会告诉我更多信息。关于分贝。就像他在看书一样。
【问题讨论】:
标签: mongodb