我有一些地方是这样的:
{
"_id" : ObjectId("575014da6b028f07bef51d10"),
"name" : "MooD",
.
.
.
"categories" : [
{
"categoryList" : [Nightlife, Bar],
"weight" : 8
},
{
"categoryList" : [Restaurant, Italian Restaurant],
"weight" : 4
}
]
}
我想按类别搜索地点,例如“酒吧”。因此,如果有“Bar”,我会查看类别的 categoryList。之后,我想按匹配类别权重的权重进行排序,以便上面的地方(Bar weight 为 8)出现在另一个 Bar weight 为 5 的地方之前。