I have two collection as below First collection is Users:
{
"userid":123,
"name":"abc",
"age":20,
"status":"Active"
}
{
"userid":345
"name":"cde"
"age":25,
"status":"Active"
}
second collection is userComment:
{
"userid":123,
"commnet":"Mongodb rocks"
}
can anyone please help me writing the query to fetch the users with "Active" status alongwith a flag that will tell me whether user has any comment or not So the o/p should be
{
"userid":123,
"name":"abc",
"age":20,
"status":"Active"
"userscommentFlag":"Y"**
}
{
"userid":345
"name":"cde"
"age":25,
"status":"Active"
"userscommentFlag":"N"
}
Thanks.