【发布时间】:2014-05-01 00:40:03
【问题描述】:
我的集合中有以下文档:
{
"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"
}
]
}
如何检索所有 cmets 的有序列表?
{
"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"
},
【问题讨论】:
标签: mongodb aggregation-framework nosql