Convert MongoDB ID to shorter strings and reverse