1,经历过的坑
- MongoDb 内层数据,需要转换类型再过滤
db.model_18300_1_origin.aggregate([
{
$unwind: {
path: "$properties"
}
},
{
$match: {
$and: [
{
"properties.name": "构件图元ID"
},
{
"properties.system": 0
},
]
}
},
{
$project: {
"name": "$properties.name",
"value": {
$convert: {
"input": "$properties.value",
"to": "decimal",
"onError": "$properties.value"
}
},
"entityId": 1,
"_id": 0
}
},
{
$sort: {"value": -1}
}
])