I had to do something similar here https://github.com/mongodb/mongo-ruby-driver/blob/1.x-stable/lib/mongo/db.rb#L225
but I explained the number in a comment. A constant is a good idea too.