{"record":{"id":"967eb88b4b385128","repo":"mongodb/mongoid","slug":"a-collation-option-cannot-be-applied-when-querying","errorCode":null,"errorMessage":"A collation option cannot be applied when querying documents in-memory.","messagePattern":"A collation option cannot be applied when querying documents in-memory\\.","errorType":"exception","errorClass":"Mongoid::Errors::InMemoryCollationNotSupported","httpStatus":null,"severity":"error","filePath":"lib/mongoid/contextual/memory.rb","lineNumber":623,"sourceCode":"      # @api private\n      #\n      # @example Set the skipping value.\n      #\n      # @param [ Integer ] value The skip.\n      #\n      # @return [ Integer ] The skip.\n      attr_writer :skipping\n\n      # Apply criteria options.\n      #\n      # @api private\n      #\n      # @example Apply criteria options.\n      #   context.apply_options\n      #\n      # @return [ Memory ] self.\n      def apply_options\n        raise Errors::InMemoryCollationNotSupported.new if criteria.options[:collation]\n\n        skip(criteria.options[:skip]).limit(criteria.options[:limit])\n      end\n\n      # Map the sort symbols to the correct MongoDB values.\n      #\n      # @example Apply the sorting params.\n      #   context.apply_sorting\n      def apply_sorting\n        return unless spec = criteria.options[:sort]\n\n        in_place_sort(spec)\n      end\n\n      # Compare two values, handling the cases when\n      # either value is nil.\n      #\n      # @api private","sourceCodeStart":605,"sourceCodeEnd":641,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/contextual/memory.rb#L605-L641","documentation":"Error \"A collation option cannot be applied when querying documents in-memory.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/contextual/memory.rb:623 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"}