pass schema when rewriting mongo ids