How to Join with multiple conditions and use aggregate function in Rethink-db
r.table("yourtable").get(id).innerJoin(
r.table("secondtable"),function (up, upp) {
return user_profile("mID")
}).map({
uId: r.row("left")("userId"),
mId: r.row("left")("memberId"),
pId: r.row("right")("projectId"),
nodeId: r.row("right")("nodeId"),
pri: r.row("right")("priority")
})
.min("priority");