{"record":{"id":"7c2f63e83b581e48","repo":"mongodb/mongoid","slug":"lte-argument-cannot-be-a-range-errors-invalid","errorCode":null,"errorMessage":"$lte argument cannot be a Range: #{Errors::InvalidQuery.truncate_expr(condition)}","messagePattern":"\\$lte argument cannot be a Range: #(.+?)","errorType":"exception","errorClass":"Mongoid::Errors::InvalidQuery","httpStatus":null,"severity":"error","filePath":"lib/mongoid/matcher/lte.rb","lineNumber":21,"sourceCode":"    # In-memory matcher for $lte expression.\n    #\n    # @see https://www.mongodb.com/docs/manual/reference/operator/query/lte/\n    #\n    # @api private\n    module Lte\n      # Returns whether a value satisfies a $lte expression.\n      #\n      # @param [ true | false ] exists Whether the value exists.\n      # @param [ Object ] value The value to check.\n      # @param [ Object ] condition The $lte condition predicate.\n      #\n      # @return [ true | false ] Whether the value matches.\n      #\n      # @api private\n      module_function def matches?(exists, value, condition)\n        case condition\n        when Range\n          raise Errors::InvalidQuery, \"$lte argument cannot be a Range: #{Errors::InvalidQuery.truncate_expr(condition)}\"\n        end\n        FieldOperator.apply_array_field_operator(exists, value, condition) do |v|\n          FieldOperator.apply_comparison_operator(:<=, v, condition)\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":3,"sourceCodeEnd":30,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/matcher/lte.rb#L3-L30","documentation":"Error \"$lte argument cannot be a Range: #{Errors::InvalidQuery.truncate_expr(condition)}\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/matcher/lte.rb:21 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0da0e23d71adfbad31128c18e5e2c8c301c6f7c4","analyzedAt":"2026-08-23T06:25:47.656Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}