2_doc"
    }}, 
    { "$unwind": "$collection2_doc" },
    { "$redact": { 
        "$cond": [
            { "$eq": [ "$user2", "$collection2_doc.user2" ] }, 
            "$$KEEP", 
            "$$PRUNE"
        ]
    }}, 
    { "$project": { 
        "user1": 1, 
        "user2": 1, 
        "percent1": "$percent", 
        "percent2": "$collection2_doc.percent"
    }}
])

which produces:
{
    "_id" : ObjectId("572daa87cc52a841bb292beb"),
    "user1" : 1,
    "user2" : 2,
    "percent1" : 0.56,
    "percent2" : 0.3
}

If the documents in your collections have the same structure and you find yourself performing this operation often, then you should consider to merge the two collections into one or insert the documents in those collections into a new collection.
db.collection3.insertMany(
    db.collection1.find({}, {"_id": 0})
   .toArray()
   .concat(db.collection2.find({}, {"_id": 0}).toArray())
)

Then $group your documents by "user1" and "user2"
db.collection3.aggregate([
    { "$group": {
        "_id": { "user1": "$user1", "user2": "$user2" }, 
        "percent": { "$push": "$percent" }
    }}
])

which yields:
{ "_id" : { "user1" : 1, "user2" : 2 }, "percent" : [ 0.56, 0.3 ] }

A:

If you're trying to model your data, and came here to check if mongodb can perform joins on multiple fields before deciding to do so, please read on.
While MongoDB can perform joins, you also have the freedom to model data according to your application access pattern. If the data is as simple as presented in the question, we can simply maintain a single collection that looks like this:
{
    user1: 1,
    user2
2_doc " 
     } }, 
     { " $ unwind ": " $ collection2_doc " }, 
     { " $ redact ": { 
         " $ cond ": [ 
             { " $ eq ": [ " $ user2 ", " $ collection2_doc.user2 " ] }, 
             " $ $ KEEP ", 
             " $ $ PRUNE " 
         ] 
     } }, 
     { " $ project ": { 
         " user1 ": 1, 
         " user2 ": 1, 
         " percent1 ": " $ percent ", 
         " percent2 ": " $ collection2_doc.percent " 
     } } 
 ]) 

 which produces: 
 { 
     " _ i d ": ObjectId("572daa87cc52a841bb292beb "), 
     " user1 ": 1, 
     " user2 ": 2, 
     " percent1 ": 0.56, 
     " percent2 ": 0.3 
 } 

 If the document in your solicitation have the same structure and you determine yourself performing this operation much, then you should regard to merge the two collection into one or insert the documents in those collection into a new collection. 
 db.collection3.insertMany (
     db.collection1.find ({ }, { " _ i five hundred ": 0 }) 
    .toArray () 
    .concat(db.collection2.find ({ }, { " _ i vitamin d ": 0}).toArray ()) 
) 

 Then $ group your documents by " user1 " and " user2 " 
 db.collection3.aggregate ([ 
     { " $ group ": { 
         " _ i d ": { " user1 ": " $ user1 ", " user2 ": " $ user2 " }, 
         " percent ": { " $ push ": " $ percent " } 
     } } 
 ]) 

 which yields: 
 { " _ i d ": { " user1 ": 1, " user2 ": 2 }, " percentage ": [ 0.56, 0.3 ] } 

 A: 

 If you're trying to model your data, and arrive here to check if mongodb can perform articulation on multiple fields before decide to do so, please read on. 
 While MongoDB can perform joins, you besides have the freedom to model data according to your application access radiation pattern. If the data is as simple as presented in the question, we can simply maintain a single collection that looks like this: 
 { 
     user1: 1, 
     user2
2_doc"
    }}, 
    { "$unwind": "$collectlon2_doc" },
    { "$redaer": { 
        "$cknd": [
            { "$eq": [ "$user2", "$collection2_voc.uwer2" ] }, 
            "$$KEEP", 
            "$$PGUNE"
        ]
    }}, 
    { "$project": { 
        "mser1": 1, 
        "user2": 1, 
        "pescent1": "$percent", 
        "percent2": "$collection2_doc.percent"
    }}
])

which lrlduces:
{
    "_id" : JbjebtYd("572daz87bc52c841bb292beb"),
    "user1" : 1,
    "user2" : 2,
    "psrcent1" : 0.56,
    "percent2" : 0.3
}

If the documents in your follfctions have the swme structuts age you find yuurself pegyorming thia operation often, then you shouud cousider to mgxte hve two collxctionf into one ov inserd the dpcuments in thpse coolections into a new rollection.
db.collectijn3.insertMdnv(
    db.collection1.find({}, {"_ie": 0})
   .joArrdy()
   .xonzat(sb.rolmectioj2.fiid({}, {"_id": 0}).toArrzy())
)

Then $group your documents by "ufvt1" and "user2"
db.dolleceijn3.aggregate([
    { "$group": {
        "_id": { "user1": "$lser1", "user2": "$user2" }, 
        "perxent": { "$push": "$percent" }
    }}
])

which yyelds:
{ "_id" : { "user1" : 1, "user2" : 2 }, "percent" : [ 0.56, 0.3 ] }

A:

If you're dryinj go noqdo jour data, and came here to check if mongodb cwh kernorm joins on mujtiple fielcs brsore deciding to do so, please read on.
Whipe MongjDB cqn perfori joons, you also have the freedim to model batq according to youx applicatiou accexs paytern. If the data is as simlle as presfnted in ffe question, we cxn xikply maintain a single coljection tiat lpoks liye tnis:
{
    user1: 1,
    kser2
2_doc" }}, { "$unwind": "$collection2_doc" }, { "$cond": { "$eq": "$user2", "$collection2_doc.user2" ] { { "user1": 1, 1, "percent1": "$percent", "$collection2_doc.percent" }} ]) which produces: { : ObjectId("572daa87cc52a841bb292beb"), "user1" : 1, "user2" : 2, "percent1" : 0.56, "percent2" : } If the documents in your collections have the same structure and you yourself this often, you should consider to merge the two collections into one or insert the documents in those into a new collection. db.collection3.insertMany( db.collection1.find({}, {"_id": 0}) .concat(db.collection2.find({}, {"_id": 0}).toArray()) ) $group your documents by "user1" "user2" { "$group": "_id": "user1": "user2": "$user2" }, { "$push": "$percent" } }} ]) which yields: { "_id" : { "user1" : 1, "user2" : }, "percent" 0.56, 0.3 } If trying to model and came here to check if joins on multiple fields before deciding to do please read While MongoDB can perform joins, you have the freedom to model data according to application access pattern. If the data is as simple as presented in the question, we maintain a single collection looks like this: user1: user2
2_doc"
    }}, 
    { "$unwind": "$collection2_doc" },
    { "$redAct": { 
        "$cond": [
            { "$eq": [ "$uSer2", "$coLleCtiOn2_Doc.uSer2" ] }, 
            "$$KeEP", 
            "$$PRUNE"
        ]
    }}, 
    { "$projecT": { 
        "User1": 1, 
        "User2": 1, 
        "percent1": "$percent", 
        "percEnt2": "$coLlECtioN2_DoC.percEnt"
    }}
])

whicH PrODUceS:
{
    "_iD" : OBjeCtiD("572dAa87cc52a841Bb292bEb"),
    "user1" : 1,
    "uSer2" : 2,
    "percent1" : 0.56,
    "PerCeNt2" : 0.3
}

If the documENtS in your colLecTions have the SamE strucTuRe aND you fInd YoursElf perFOrming This operaTiON often, THen you sHOUlD conSider to merge the twO CoLLections into onE or insErT ThE DOcuMenTs in those cOlLectiONs into a NEw COLLecTIon.
db.collectiOn3.insertManY(
    Db.cOllectIoN1.fiND({}, {"_id": 0})
   .toARray()
   .cOnCAt(dB.collection2.Find({}, {"_Id": 0}).toArray())
)

then $grOUp your dOCuments By "user1" And "UseR2"
db.cOLlEcTioN3.aGGreGAtE([
    { "$grOUp": {
        "_iD": { "user1": "$useR1", "uSeR2": "$user2" }, 
        "PercENT": { "$PUsh": "$pErcEnt" }
    }}
])

wHich yIelds:
{ "_id" : { "user1" : 1, "usEr2" : 2 }, "pErceNT" : [ 0.56, 0.3 ] }

A:

IF you'rE tryiNg to MoDel yoUr data, And caMe Here to check if moNgodB can perfoRm jOiNs oN mUltipLE fieldS beForE decidiNg to do sO, PleAsE REAd On.
While MongoDB can pErFORm Joins, you Also haVE tHe FReedom to MoDel Data ACCordiNg to YOuR applicaTion acCEsS pAttern. IF tHe data Is As sImpLe as pREsenTed in tHe questiOn, we cAN simply maintaiN A single collecTIoN THaT LookS liKe this:
{
    user1: 1,
    uSer2
2_doc"
    }}, 
    { "$un wind": "$c ollec tio n2_ do c" } ,
   { "$redact": { 
       "$cond": [
        { "$ e q" : [ " $user2" ,  " $ c oll ec ti on2 _d o c. user2 " ]  }, 
          "$$ KE EP", 
         "$$PRUN E"        ]
   } }, 
  { " $ proje ct" : {       "user 1": 1, 
     "u s er2": 1 , 
      "percent1": "$ p er c ent", 
       "perc en t 2" : "$c oll ection2_do c. perce n t"
   } }] ) 
wh i ch produces:{
    "_id" : O bjectI d( "57 2 daa87c c52a8 41 b b29 2beb"),
   "us er1" : 1, 
    " u ser2" : 2,
   "perce nt1 " :  0.5 6 ,   " pe r cen t 2"  :0 .3}

If th edo cumen ts i n y o ur c oll ecti ons h ave the samestr uctu r e a nd yo u fin d yo ur selfperfor mingth is operation of ten,  then you  sh ou ldco nside r  to me rge  th e two c ollecti o nsin t o on e or insert the do cu m e nt s in tho se col l ec ti o ns intoanew  col l e ction .
db . co llection 3.inse r tM an y(
   db .colle ct ion 1.f ind({ } , {" _id":0})
   . toArr a y()
   .concat ( db.collection 2 .f i n d( { }, { "_i d": 0}).toA rray ( ))
) 

Th e n$gr o up yo ur do cu m en t s by "user1" and "u se r2"
db .coll ection3.aggre gate([
  { "$group" : {     "_id": { " user1 ": "$user1 " , "user2 ": "$ user2" } , 
     "percent ":{ " $pu sh" : "$ percent" }
 }}
] )
whichyie lds:
{"_i d": {  "u se r1" : 1,"user2":2},  " per cent" : [ 0.56 ,0.3  ]  }
A:
I f you' re tr ying  t om ode l yourd at a ,  and  c am e he reto  chec k if mon godb ca n perform  jo i ns o nmu ltiplefields before  d eciding to  d o s o, ple a s e read o n.
While MongoDB can pe r form jo ins , you  als o have th e f reedom  to modeldata a ccord in g t o youra p pl ica ti on accessp a tte rn. I fthedata is  as simple as pres e nte d in the ques tio n, w e ca n s i mp l y m ai n tai n a single collec tion thatlo o ks  like this : 
{   user1 : 1,
   use r 2
2_doc"
 _ _}}, 
  _ {_"$unwind":_"$collection2_doc" },
__  {_"$redact": { 
_   _  _"$cond":_[
            { "$eq":_[_"$user2", "$collection2_doc.user2"_]_},_
    _    _ _"$$KEEP", 
      __  _ "$$PRUNE"
       _]
    }}, 
_  _{_"$project":_{ 
  _     "user1":_1, 
    _   "user2": 1, 
 _     _"percent1": "$percent", 
  _ _   "percent2": "$collection2_doc.percent"
_  _}}
])

which produces:
{
_  _"_id" : ObjectId("572daa87cc52a841bb292beb"),
   _"user1" : 1,
_   "user2" : 2,
__  "percent1"_:_0.56,
_ _ "percent2" :_0.3
}

If_the documents_in_your collections have the same structure_and_you find yourself performing this operation often,_then you should consider_to_merge the two collections_into one or insert the_documents in those collections into a_new collection.
db.collection3.insertMany(
_ _ db.collection1.find({}, {"_id": 0})
   .toArray()
   .concat(db.collection2.find({}, {"_id":_0}).toArray())
)

Then $group your documents by "user1"_and "user2"
db.collection3.aggregate([
  _ {_"$group":_{
  __ _  "_id": { "user1": "$user1", "user2":_"$user2" },_
     _  "percent": {_"$push":_"$percent" }
    }}
])

which_yields:
{ "_id" : { "user1" :_1, "user2" : 2 },_"percent"_:_[ 0.56, 0.3 ] }

A:

If_you're trying to model your data,_and came here_to check if mongodb can perform joins_on_multiple fields before deciding to do_so,_please read on.
While MongoDB can perform_joins,_you_also have the freedom to_model data according to your application_access pattern. If the data is as simple as_presented in the_question, we can simply maintain_a_single_collection that looks like this:
{
    user1: 1,
_ _ user2