,
"cate_id" : "223",
"list_order" : "6",
}
平常用Mysql比较多所以在查询时自然想到ORDER BY list_order DESC,
但是MongoDB...并不能按照数字来排序字符串字段值,
上面list_order字符串值需要在个位数字前面补“0” 01,02,03,04,05,06,07,08,09,10,11 这样才能返回想要的排序结果。..."author" : "Mike Wilson",
"cate_id" : "223",
"list_order" : NumberLong(6),
}
注意:如果用字符串进行排序