Functor helper for mongodb, to be used with ocsigen