我有这样的架构。
const Company = new mongoose.Schema({
profile: {
name: String,
email: String,
password: String,
description: String,
phone: String,
location: {
address: String,
latitude: Number,
longitude: Number
}
},
posts: Array,
permission: { type: Number, default: 1 },
});
我必须按距离、名称等搜索...
问题是按距离搜索。
如何通过距离加名称等进行查询?
谢谢