Added toId fn on mongo lib