merged mongo client code