Допустим, у меня есть этот самый базовый c поиск
const from = 'something';
const to = 'somethingElse';
const firstSearchCondition = { from, to: 'test' };
const secondSearchCondition = { from: 'test', to };
const models = await Model.findAll({
where: {
[Op.or]: [
firstSearchCondition,
secondSearchCondition
],
},
});
const [toTest, fromTest] = models;
if (toTest && fromTest) {
// both models exist
}
, когда существуют обе модели, это toTest
100% от firstSearchCondition? или заказ не гарантирован