I have looked up the manual of MongoDB, but cannot find a proper solution to do the following search:
Document structure:
{
"_id" : ObjectId("57201082e92c07baef62452a"),
"user_id" : 1,
"profile" : [
{
"date" : ISODate("2012-10-11T12:58:06.000Z"),
"content" : [
{
"feature_id" : 1,
"feature_value" : true
}
]
},
{
"date" : ISODate("2013-04-12T8:23:09.000Z"),
"content" : [
{
"feature_id" : 1,
"feature_value" : false
}
]
}
]
}
What I want to get is the LATEST feature_value of a given user_id and a given feature_id.
Is there any way to accomplish this using MongoDB?
Thanks.