Here is the answer to my issue that i found. May be this would be helpful for others. The embedded document ids should be of MongoId object type, in my case i was using followerid as a simple string but it should be a MongoId object. so the schema should be
{
"_id": ObjectId("52cd49c2f770df1c0b000001")
"datejoined": ISODate("2014-01-08T12:51:14.0Z"),
"firstname": "Huston",
"followers": NumberInt(1),
"following": [
{
"followerid": ObjectId("52a97985f770dfdc04000000"),
"type": "user",
"followedon": ISODate("2014-01-23T07:08:43.0Z")
}
],
"lastname": "Ted",
"trackscount": NumberInt(0)
}
{
"_id": ObjectId("529726caf770dff815000001")
"datejoined": ISODate("2014-01-08T12:51:14.0Z"),
"firstname": "Ted",
"followers": NumberInt(3),
"following": [
{
"followerid": ObjectId("528c62406a542f7c6a6bf522"),
"type": "track",
"followedon": ISODate("2014-01-23T06:53:13.0Z")
},
{
"followerid": ObjectId("52a97985f770dfdc04000000"),
"type": "user",
"followedon": ISODate("2014-01-23T07:08:43.0Z")
},
{
"followerid": "52a97985f770dfdc04000023",
"type": "track",
"followedon": ISODate("2014-01-24T06:23:30.0Z")
}
],
"lastname": "Terry",
"trackscount": NumberInt(0)
}