我有这个模特用户
模型:用户
u_email: String,
u_password: String,
u_displayed:Boolean,
u_info:[
{
pi_id:{type: Schema.Types.ObjectId, ref: 'wt_infos'},
key:String,
value:String,
}],
示例
"u_info" : [
{
"value" : "200",
"key" : "budget",
"pi_id" : ObjectId("5adf5bb8c7091c39300223cd")
},
{
"value" : "23/02/2019",
"key" : "date",
"pi_id" : ObjectId("5adf5bb8c7091c39300223cf")
},
如何根据我的字段“预算”对我的用户进行排序,该字段应转换为int并使用聚合使用 5adf5bb8c7091c39300223cd