I am new to MongoDB, here I need to form a new table from different collections where it should look like this,
userId userName email phone role
Here according to userId, I need all information from different Collections.
Data:
> db.userinfo.find().pretty()
{
"_id" : ObjectId("56d82612b63f1c31cf906003"),
"userId" : "AD",
"phone" : "0000000000"
}
> db.userrole.find().pretty()
{
"_id" : ObjectId("56d82612b63f1c31cf906003"),
"userId" : "AD",
"role" : "admin"
}
> db.users.find().pretty()
{
"_id" : ObjectId("5684f3c454b1fd6926c324fd"),
"email" : "admin@gmail.com",
"userId" : "AD",
"userName" : "admin"
}