Escape and unescape $ and . (dot) for storing documents in mongodb