Details
-
Improvement
-
Resolution: Done
-
Major - P3
-
None
-
None
-
mongodb version 2.4.10
*Location*: http://docs.mongodb.org/manual/reference/operator/aggregation/sort/
*User-Agent*: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
*Referrer*: http://www.baidu.com/s?wd=mongodb%20aggregate%20sort&oq=mongodb%20agg&ie=utf-8&f=8&tn=baidu&rsv_bp=1&rsv_enter=1&rsv_sug3=54&rsv_sug4=6732&rsv_sug1=32&sug=mongodb%20aggregate&rsv_n=1&rsv_sug2=0&inputT=4843
*Screen Resolution*: 1920 x 1080
*repo*: docs
*source*: reference/operator/aggregation/sort
mongodb version 2.4.10 *Location*: http://docs.mongodb.org/manual/reference/operator/aggregation/sort/ *User-Agent*: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 *Referrer*: http://www.baidu.com/s?wd=mongodb%20aggregate%20sort&oq=mongodb%20agg&ie=utf-8&f=8&tn=baidu&rsv_bp=1&rsv_enter=1&rsv_sug3=54&rsv_sug4=6732&rsv_sug1=32&sug=mongodb%20aggregate&rsv_n=1&rsv_sug2=0&inputT=4843 *Screen Resolution*: 1920 x 1080 *repo*: docs *source*: reference/operator/aggregation/sort
Description
how could I sort by one field of the subDocument???
example:
VodInfo1 = {id:1,bindCategory : [
VodInfo2 = {id:2,bindCategory : [{categoryId:2,bindTime:‘201405’},{categoryId:1,bindTime:‘201405’}
]};
I want to sort by bindCategory.bindTime and bindCategory.catgoryId = 1