Funny issue; localStorage and MongoDB
It's nothing about MongoDB, it's the AJAX call.
The string in response of an AJAX call will be converted to character entities, or they will break ur DOM with characters like '<'. All u need to do is converted them back.
I'm having a peculiar issue. I'm reading the HTML from a div contenteditable, and then sending an AJAX request to my backend that saves that HTML to a mongodb document, and I also save that exact same HTML to localStorage. 
And, guess what happens? When the text is loaded back later, the localStorage renders fine, but, the data retrieved from the database turns into text with &nbsp's and <div>s scattered throughout. Does MongoDB do something to the data before saving it?