【发布时间】:2022-11-21 16:46:03
【问题描述】:
enter image description here 我正在尝试使用 mongosh 通过引用 child1 文档来检索其他兄弟姐妹的详细信息,即 Child2 和 Child3。 我应该使用什么 mongosh 条件来获取这个而不是 child1 和 father 文档?
我尝试了聚合方法和查找方法,我尝试应用使用 parent_id 的逻辑,这在其他兄弟姐妹中很常见,但它也会打印 child1 id。帮助!
【问题讨论】:
标签: mongodb mongoose mongodb-query aggregation-framework mongo-shell