diff --git a/lib/dao.js b/lib/dao.js index 75bb0b09..d39e3504 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -1536,7 +1536,7 @@ DataAccessObject.find = function find(query, options, cb) { this.applyScope(query); - const near = query && geo.nearFilter(query.where); + let near = query && geo.nearFilter(query.where); const supportsGeo = !!connector.buildNearFilter; if (near) { @@ -1567,6 +1567,8 @@ DataAccessObject.find = function find(query, options, cb) { } function queryGeo(query) { + near = query && geo.nearFilter(query.where); + function geoCallbackWithoutNotify(err, data) { const memory = new Memory(); const modelName = self.modelName;