Compatibility with Mongoid 4.x.