Based on an upcoming cross-driver specification, this should use the idioms and classes introduced in the new CRUD APi, rather than the deprecated com.mongodb.DB API.