Sunday 25 August 2013

MapReduce on two Collections using MongoDB and C#

MapReduce on two Collections using MongoDB and C#

I have two collections with the following details:
Comments
{"_id" : ObjectId("521588ccb5d44d23aca151a2"), "UserId" :
"5215862eb5d44d23aca1519d", "Comment" : "hello" }
{"_id" : ObjectId("521588ccb5d44d23aca151a2"), "UserId" :
"5215862eb5d44d23aca1519e", "Comment" : "this is cool" }
User
{ "_id" : ObjectId("5215862eb5d44d23aca1519d"), "Nickname" : "Jane"}
{ "_id" : ObjectId("5215862eb5d44d23aca1519e"), "Nickname" : "Jon"}
I want to achieve the following
{ "UserId" : "5215862eb5d44d23aca1519d", "Comment": "Hello", "Nickname" :
"Jane"}
{ "UserId" : "5215862eb5d44d23aca1519e", "Comment": "this is cool",
"Nickname" : "Jon"}
I am using MongoDB with the C# drivers. Thanks in advance....

No comments:

Post a Comment