Implementing Mongo::Client#with.