private function buildBetweenCondition($operator, $operands)
{
if (!isset($operands[0], $operands[1], $operands[2])) {
throw new InvalidParamException("Operator '{$operator}' requires three operands.");
}
list($column, $value1, $value2) = $operands;
if ($column == '_id') {
throw new NotSupportedException('Between condition is not supported for the _id field.');
}
$filter = ['range' => [$column => ['gte' => $value1, 'lte' => $value2]]];
if ($operator == 'not between') {
$filter = ['not' => $filter];
}
return $filter;
}