the artist collection consists of the detail of the artist and the art collection consist of the detail of the art by the particular artist. I want to merge both of them . I'm new to mongodb,in SQL I know how to perform the operation, but finding it difficult with mongo
Artist collection
{
"_id" : ObjectId("571113f39542ab860bce85d7"),
"name" : "ajay",
"email" : "[email protected]",
"password" : "d6124b9d34be470dd0387dff9170c825cf8934ed",
"country" : "in",
"address" : "mysore",
"date_of_birth" : {
"year" : "1992:05:03"
},
"type" : "artist"
}
Art Collection
{
"_id" : ObjectId("57161d2307e2432a49082903"),
"type" : null,
"originalname" : null,
"user_id" : "571113f39542ab860bce85d7",
"fullPath" : "/code/wd/artifu/backend/uploads/568eec81d2051abe2996f7139d46d143.png",
"created" : ISODate("2016-04-19T11:57:23.731Z"),
"data" : {
"title" : "image",
"description" : "description",
"tags" : "forest"
}
}
populatefunction ofMongoose, if you are allowed to use it.