如何在mongodb中联接两个表 [英] how to join two tables in mongodb

查看:93
本文介绍了如何在mongodb中联接两个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在mongodb中联接两个表.

how to join two tables in mongodb.

例如, 表1:用户 表2:示例

For example, table 1 : users table 2 : examples

这里的users表具有用户名,examples表也具有用户名,因此如何在php中使用mongodb合并两个表字段.

Here users table having username and examples table also having username, so how to combine both table fields using mongodb in php.

请解释该查询.

谢谢

推荐答案

不幸的是,在MongoDB中没有直接的合并/合并操作.无论如何,您可以使用映射和归约功能以适当地合并数据.

Unfortunately there is no merging/joining operation directly in MongoDB. Anyway, you can use the map-and-reduce functionality in order to combine the data appropriately.

根据您的实际问题,以下链接可能会有所帮助:

Depending on your actual problem, the following links might be of help:

> MongoDB:将多个集合中的数据合并为一个..如何?

在MongoDB中合并两个集合

http://www .pal-blog.de/entwicklung/mongodb/mapreduce-multiple-mongodb-collections-into-one.html

https://groups.google.com/forum/# !topic/mongodb-user/OQUH_wxYyRg

https://groups.google.com/forum/# !topic/mongodb-user/qxa7ZBTk7sQ

这篇关于如何在mongodb中联接两个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆