I have embedded data of user in authentication token schema and i want to fetch the token on the basis of username/email.
My json is in database is :
{
"_id" : ObjectId("556573e744ae59c06a45533e"),
"_class" : "com.samepinch.domain.user.AuthenticationToken",
"token" : "c19f368e-8734-4a17-970e-e60e77dd955b",
"user" : {
"_id" : ObjectId("556566ca44ae69d5428778c5"),
"age" : 0,
"username" : "[email protected]",
"firstName" : "Qasim",
"lastName" : "Siddiqui",
"email" : "[email protected]",
"gender" : "male",
"createdDate" : ISODate("2015-05-27T06:40:10.871Z"),
"updatedDate" : ISODate("2015-05-27T06:40:10.871Z")
}
}