从一个 collection A里选出 一组父节点后, 根据fatherId 要到另一个collection B里 找到 所有的子节点 修改。
father = [....]
根据 father 里的fatherId 到集合 B 里找所有子节点。
从一个 collection A里选出 一组父节点后, 根据fatherId 要到另一个collection B里 找到 所有的子节点 修改。
father = [....]
根据 father 里的fatherId 到集合 B 里找所有子节点。
请教一下
select * from user where (name=1 or name=2) and (age=1 or age=2)
这样的语句,怎么用mongo写出来?
3 回答2.6k 阅读✓ 已解决
1 回答940 阅读✓ 已解决
2 回答1.2k 阅读
1 回答931 阅读✓ 已解决
2 回答1.7k 阅读
2 回答623 阅读✓ 已解决
2 回答1.1k 阅读
a.find().populate('fatherId')
声明的schema里加上ref就行了