我自己修好了。
我在模型中这样做:
loc : { type: {type:String}, coordinates: [Number]},
在下面,我将其设为2dsphere索引。
eventSchema.index({loc: '2dsphere'});
并向其中添加数据:
loc: { type: "Point", coordinates: [ longitude, latitude ] },
欢迎分享,转载请注明来源:内存溢出
我自己修好了。
我在模型中这样做:
loc : { type: {type:String}, coordinates: [Number]},
在下面,我将其设为2dsphere索引。
eventSchema.index({loc: '2dsphere'});
并向其中添加数据:
loc: { type: "Point", coordinates: [ longitude, latitude ] },
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)