rewriteIds for string type of _id