dimanche 23 mars 2014

Select and order all subdocuments from a collection


Vote count:

0




I have the following documents in a collection:



{
"thread_object": "Sed consectetur, massa id aliquam lacinia",
"thread_comments": [
{
"comment_date": "11/01/2014 17:23:19",
"comment_user": "Integer",
"comment_content": "In suscipit enim at eleifend auctor"
},
{
"comment_date": "12/01/2014 17:23:19",
"comment_user": "Suspendisse",
"comment_content": "Quisque facilisis magna pellentesque diam mollis"
}
]
},
{
"thread_object": "Vivamus auctor mauris augue",
"thread_comments": []
},
{
"thread_object": "Phasellus volutpat, sem id convallis elementum",
"thread_comments": [
{
"comment_date": "10/01/2014 17:23:19",
"comment_user": "Donec",
"comment_content": "Suspendisse a pellentesque justo"
}
]
}


How can I retrieve an ordered list of all the comments?



{
"comment_date": "10/01/2014 17:23:19",
"comment_user": "Donec",
"comment_content": "Suspendisse a pellentesque justo"
},
{
"comment_date": "11/01/2014 17:23:19",
"comment_user": "Integer",
"comment_content": "In suscipit enim at eleifend auctor"
},
{
"comment_date": "12/01/2014 17:23:19",
"comment_user": "Suspendisse",
"comment_content": "Quisque facilisis magna pellentesque diam mollis"
},


asked 36 secs ago






Aucun commentaire:

Enregistrer un commentaire