I have one document that I want to run nested aggregation on this, but I don't know how to run this operation.
Content document (removed unnecessary fields):
{
"_id" : ObjectId("5a6b8b734f1408137f79e2cc"),
"reviews" : [
{
"_id" : ObjectId("5a6cf7c41562160494238781"),
"headline" : "",
"body" : "",
"likeUsers" : [
{
"_id" : ObjectId("5a6b5f2e1fc2a11c5c83a6e2")
}
],
"dislikeUsers" : [],
"isCritic" : false,
"isSpoilers" : false,
"isTop" : true,
"rate" : 3,
"userId" : ObjectId("5a6b5f2e1fc2a11c5c83a6e2"),
"date" : Timestamp(1517090823, 1)
}
]
}
user content:
{
"_id" : ObjectId("5a6b5f2e1fc2a11c5c83a6e2"),
"username" : "",
"password" : "",
"firstname" : "",
"lastname" : "",
"email" : "",
"mobile" : "",
"tel" : "",
"nationalCode" : "",
"gender" : "male",
"birthdate" : Timestamp(0, 1),
"promotionCode" : "12131SKSQ",
"status" : 1,
"created" : Timestamp(1516986633, 1),
"updated" : Timestamp(1516986633, 2)
}
I want to get all users information from likeUsers array field.
$lookupaggregate pipeline for joining with other collection