If a matching Document is not found and Mongoid.raise_not_found_error is true it raises Mongoid::Errors::DocumentNotFound, return null nil elsewise.

So a global config option affects the semantics of this method quite fundamentally. Didn't we agree this was a bad idea back in the php.ini days?

The upshot is that any library code using mongoid is unable to give any guarantees about its behaviour in error situations because it doesn't know how the app it's embedded into has set its configuration options.

I grant that ActiveRecord has its own design problems, but if you're going to ignore it in favour of doing your own thing, maybe at least try not to make it worse?