在Mongoose模型上找不到geoNear?

时间:2015-04-26 03:44:36

标签: node.js mongodb mongoose

我很困惑为什么在我的猫鼬模型上找不到geoNear:

var location = { type : 'Point', coordinates : coordinates };

Shift.geoNear(location, { maxDistance : 5, spherical : true }, function(err, results, stats) {
    response.json(results);
    console.log(stats);
});

TypeError: Object function model(doc, fields, skipId) {
 if (!(this instanceof model))
  return new model(doc, fields, skipId);
  Model.call(this, doc, fields, skipId);
 } has no method 'geoNear'

0 个答案:

没有答案