{"record":{"id":"ff8c7d2e7936700f","repo":"mongodb/mongoid","slug":"calling-criteria-methods-with-nil-arguments-is-not","errorCode":null,"errorMessage":"Calling Criteria methods with nil arguments is not allowed.","messagePattern":"Calling Criteria methods with nil arguments is not allowed\\.","errorType":"exception","errorClass":"Mongoid::Errors::CriteriaArgumentRequired","httpStatus":null,"severity":"error","filePath":"lib/mongoid/criteria/queryable/selectable.rb","lineNumber":44,"sourceCode":"        #\n        # @example Add the criterion.\n        #   selectable.all(field: [ 1, 2 ])\n        #\n        # @example Execute an $all in a where query.\n        #   selectable.where(:field.all => [ 1, 2 ])\n        #\n        # @param [ Hash... ] *criteria The key value pair(s) for $all matching.\n        #\n        # @return [ Selectable ] The cloned selectable.\n        def all(*criteria)\n          if criteria.empty?\n            return clone.tap do |query|\n              query.reset_strategies!\n            end\n          end\n\n          criteria.inject(clone) do |query, condition|\n            raise Errors::CriteriaArgumentRequired, :all if condition.nil?\n\n            condition = expand_condition_to_array_values(condition)\n\n            if strategy\n              send(strategy, condition, '$all')\n            else\n              condition.inject(query) do |_query, (field, value)|\n                v = { '$all' => value }\n                v = { '$not' => v } if negating?\n                _query.add_field_expression(field.to_s, v)\n              end\n            end\n          end.reset_strategies!\n        end\n        alias all_in all\n        key :all, :union, '$all'\n\n        # Add the $and criterion.","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/criteria/queryable/selectable.rb#L26-L62","documentation":"Error \"Calling Criteria methods with nil arguments is not allowed.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/criteria/queryable/selectable.rb:44 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"}