Add counting support to mongo mapper