adapte to mongodb-erlang fork version by kevin lynx