<p>我有这样的用户文档集:</p>
<pre><code>User {
id:"001"
name:"John",
age:30,
friends:["userId1","userId2","userId3"....]
}
</code></pre>
<p>一个用户有很多朋友,我在SQL中有以下查询:</p>
<pre><code>select * from user where in (select friends from user where id=?) order by age
</code></pre>
<p>我想在MongoDB中有类似的东西。</p>