Merge pull request #1742 from strongloop/fix/hooks-with-near-queries-3x
Fix implementation of Operation Hooks for "near" (geo) queries
This commit is contained in:
commit
5e3e1198d6
|
@ -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;
|
||||
|
|
|
@ -917,6 +917,9 @@ describe('Unoptimized connector', function() {
|
|||
ds.connector.findOrCreate = false;
|
||||
ds.connector.upsertWithWhere = false;
|
||||
|
||||
// disable native location queries
|
||||
ds.connector.buildNearFilter = false;
|
||||
|
||||
require('./persistence-hooks.suite')(ds, should, {
|
||||
replaceOrCreateReportsNewInstance: true,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue