minor rewrite of mongoDB adapter