Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Join multiple collections on multiple keys using map reduce in Mongo DB.

Received: by 10.66.86.102 with SMTP id o6mr1851042paz.41.1348801791082;
        Thu, 27 Sep 2012 20:09:51 -0700 (PDT)
X-BeenThere: mongodb-user@googlegroups.com
Received: by 10.68.197.72 with SMTP id is8ls12362617pbc.5.gmail; Thu, 27 Sep
 2012 20:09:34 -0700 (PDT)
Received: by 10.68.216.132 with SMTP id oq4mr1907737pbc.8.1348801774596;
        Thu, 27 Sep 2012 20:09:34 -0700 (PDT)
Date: Thu, 27 Sep 2012 20:09:33 -0700 (PDT)
From: William Zola <william.z...@10gen.com>
To: mongodb-user@googlegroups.com
Message-Id: <5b145033-c82d-4fdf-9e10-c5850ca206b4@googlegroups.com>
In-Reply-To: <5420156b-ad88-4f21-9d1d-e0cbc0cffe79@googlegroups.com>
References: <5420156b-ad88-4f21-9d1d-e0cbc0cffe79@googlegroups.com>
Subject: Re: Join multiple collections on multiple keys using map reduce in
 Mongo DB.
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_324_14553756.1348801773975"

------=_Part_324_14553756.1348801773975
Content-Type: multipart/alternative; 
	boundary="----=_Part_325_26732074.1348801773975"

------=_Part_325_26732074.1348801773975
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Anand -- are you trying to do this with standard queries, or with mapReduce?

 -William 

On Wednesday, September 26, 2012 4:55:03 PM UTC-7, Anand Dayalan wrote:
>
> I know a way to join multiple collections using a same key, and I thinks 
> its not possible to join multiple collections on multiple keys but 
> wondering anyone know a way to do it.
>
> Lets say I have a collection AAA with fields A, B, and C, and I have a 
> collection called BBB with fields B, D and E, and I have another collection 
> called CCC with fields C, F, G.
>
> In collection AAA field B is DB Ref for field B in collection BBB, and 
> field C in collection AAA is a DB ref for field C in collection CCC. Now I 
> want join these three collections like AAA join BBB on AAA.B =BBB.B , BBB 
> join CCC on BBB.C = CCC.C.
>
> I know that I can embed one collection in another but I have a situation 
> where I can't embed everything but need to do a adhoc report across 
> multiple collection. So how do I do it?
>

------=_Part_325_26732074.1348801773975
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Anand -- are you trying to do this with standard queries, or with mapReduce=
?<div><br></div><div>&nbsp;-William&nbsp;<br><br>On Wednesday, September 26=
, 2012 4:55:03 PM UTC-7, Anand Dayalan wrote:<blockquote class=3D"gmail_quo=
te" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;paddi=
ng-left: 1ex;"><p style=3D"font-size:14px;clear:both;word-wrap:break-word;c=
olor:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-seri=
f">I know a way to join multiple collections using a same key, and I thinks=
 its not possible to join multiple collections on multiple keys but wonderi=
ng anyone know a way to do it.</p><p style=3D"font-size:14px;clear:both;wor=
d-wrap:break-word;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','Dej=
aVu Sans',sans-serif">Lets say I have a collection AAA with fields A, B, an=
d C, and I have a collection called BBB with fields B, D and E, and I have =
another collection called CCC with fields C, F, G.</p><p style=3D"font-size=
:14px;clear:both;word-wrap:break-word;color:rgb(0,0,0);font-family:Arial,'L=
iberation Sans','DejaVu Sans',sans-serif">In collection AAA field B is DB R=
ef for field B in collection BBB, and field C in collection AAA is a DB ref=
 for field C in collection CCC. Now I want join these three collections lik=
e AAA join BBB on AAA.B =3DBBB.B , BBB join CCC on BBB.C =3D CCC.C.</p><p s=
tyle=3D"font-size:14px;clear:both;word-wrap:break-word;color:rgb(0,0,0);fon=
t-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif">I know that I ca=
n embed one collection in another but I have a situation where I can't embe=
d everything but need to do a adhoc report across multiple collection. So h=
ow do I do it?</p></blockquote></div>
------=_Part_325_26732074.1348801773975--

------=_Part_324_14553756.1348801773975--