Harpreet Sangar
06/04/2024, 4:56 AM"sort_by": "$availability_warehouse_1(_eval(is_available:true):desc), $availability_warehouse_357(_eval(is_available:true):desc), is$availability_warehouse_1181(_eval(is_available:true):desc)"
But it's not possible to merge the fields such that if a product is available in any one of these warehouses the document would have is_available:true
. Merge including will have the value of the last reference doc merged. So you'll have to add some front-end logic in this case to check for the availability.