我在MongoDB的“products”集合中有一个来自“users”集合的文档引用。当我更新“users”集合中实际文档中的字段时,它已成功更新,但其数据在引用位置未更新。a user in 'users' collection这是“users”集合中的我的用户,它在“products”集合中的文档中被引用,如图所示。user document from 'users' referenced in 'products' collection当我获取这个文档时,我需要用户的数据以及产品的其他数据,但它给我的响应如下所示。query response我尝试过一些包含聚合、管道查询。2我无法得到回应。3可能是我在写查询时哪里错了。4任何帮助都将不胜感激。5谢谢。
1条答案
按热度按时间t1qtbnec1#
我不确定这是您的意思,但是您可以 checkout
lookup
聚合。}