我是MongoDB的新成员,我不知道如何像mysql一样处理多个集合的查询和排序。有两个集合如下:
// Collection customer:
{"id":01, "name":"a", "age":18}
{"id":02, "name":"b", "age":17}
{"id":03, "name":"b", "age":22}
// Collection point:
{"id":01, "customer_id":"01", "point":50}
{"id":02, "customer_id":"01", "point":150}
{"id":03, "customer_id":"02", "point":150}
{"id":04, "customer_id":"02", "point":50}
{"id":05, "customer_id":"01", "point":150}
{"id":06, "customer_id":"03", "point":50}
{"id":07, "customer_id":"03", "point":150}如何获得像mysql这样的查询:选择a.id作为id,a.point作为点,b.age作为年龄,从点作为一个左连接客户作为b,a.customer_id = b.id的顺序按年龄限制0,5‘
https://stackoverflow.com/questions/35011350
复制相似问题