Differential D213 Diff 1056 test_utils/access-strategy-types/create_strategies_with_complex_pipeline.js
Changeset View
Changeset View
Standalone View
Standalone View
test_utils/access-strategy-types/create_strategies_with_complex_pipeline.js
Show All 11 Lines | for (const strategy of access_strategies) { | ||||
name: strategy, | name: strategy, | ||||
getRestrictingQuery: async function() { | getRestrictingQuery: async function() { | ||||
const query = new Query(); | const query = new Query(); | ||||
const id = query.lookup({ | const id = query.lookup({ | ||||
from: "numbers", | from: "numbers", | ||||
localField: "body.number", | localField: "body.number", | ||||
foreignField: "sealious_id", | foreignField: "sealious_id", | ||||
}); | }); | ||||
return query.match({ | query.match({ | ||||
[`${id}._id`]: { | [`${id}._id`]: { | ||||
$exists: strategy === "complex-allow-pipeline", | $exists: strategy === "complex-allow-pipeline", | ||||
}, | }, | ||||
}); | }); | ||||
return query; | |||||
}, | }, | ||||
checker_function: function() { | checker_function: function() { | ||||
return Promise.resolve(); | return Promise.resolve(); | ||||
}, | }, | ||||
item_sensitive: true, | item_sensitive: true, | ||||
}); | }); | ||||
} | } | ||||
}, | }, | ||||
}; | }; |